Skip to content

Commit b4a4f9a

Browse files
committed
Merged catalog to general push workflow
1 parent 67a9290 commit b4a4f9a

File tree

2 files changed

+29
-33
lines changed

2 files changed

+29
-33
lines changed

.github/workflows/_push.yaml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ on:
6262
required: false
6363
type: string
6464

65+
CATALOG_DIR_PATH:
66+
description: OPM CLI version to use
67+
default: catalog
68+
required: false
69+
type: string
70+
6571
secrets:
6672
ADMIN_TOKEN:
6773
description: "Secret to pull latest tag"
@@ -107,6 +113,15 @@ jobs:
107113
exit 1
108114
fi
109115
116+
- name: Check if Catalog release is needed
117+
id: check-catalog-changes
118+
run: |
119+
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^${{CATALOG_DIR_PATH}}/'; then
120+
echo "should_release_catalog=true" >> $GITHUB_ENV
121+
else
122+
echo "should_release_catalog=false" >> $GITHUB_ENV
123+
fi
124+
110125
- name: Set up Go
111126
id: go
112127
uses: actions/setup-go@v5
@@ -210,12 +225,20 @@ jobs:
210225
env:
211226
VERSION: ${{ needs.push-operator-setup.outputs.new_tag_without_v }}
212227

213-
- name: Push changes
214-
if: ${{ env.commit_made == 'true' }}
215-
uses: ad-m/github-push-action@master
216-
with:
217-
github_token: ${{ secrets.ADMIN_TOKEN }}
218-
branch: ${{ inputs.RELEASE_BRANCH }}
228+
- name: Build and Push Catalog
229+
if: env.should_release_catalog == 'true'
230+
run: make catalog-render catalog-build catalog-push
231+
env:
232+
VERSION: ${{ needs.push-operator-setup.outputs.new_tag_without_v }}
233+
234+
- name: Push Latest Tag
235+
if: env.should_release_catalog == 'true'
236+
uses: anothrNick/[email protected]
237+
env:
238+
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }}
239+
WITH_V: true
240+
RELEASE_BRANCHES: ${{ inputs.RELEASE_BRANCH }}
241+
DEFAULT_BUMP: patch
219242

220243
- name: Comment on PR
221244
uses: mshick/add-pr-comment@v2

.github/workflows/push_catalog.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)