|
62 | 62 | required: false
|
63 | 63 | type: string
|
64 | 64 |
|
| 65 | + CATALOG_DIR_PATH: |
| 66 | + description: OPM CLI version to use |
| 67 | + default: catalog |
| 68 | + required: false |
| 69 | + type: string |
| 70 | + |
65 | 71 | secrets:
|
66 | 72 | ADMIN_TOKEN:
|
67 | 73 | description: "Secret to pull latest tag"
|
@@ -107,6 +113,15 @@ jobs:
|
107 | 113 | exit 1
|
108 | 114 | fi
|
109 | 115 |
|
| 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 | +
|
110 | 125 | - name: Set up Go
|
111 | 126 | id: go
|
112 | 127 | uses: actions/setup-go@v5
|
@@ -210,12 +225,20 @@ jobs:
|
210 | 225 | env:
|
211 | 226 | VERSION: ${{ needs.push-operator-setup.outputs.new_tag_without_v }}
|
212 | 227 |
|
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 |
219 | 242 |
|
220 | 243 | - name: Comment on PR
|
221 | 244 | uses: mshick/add-pr-comment@v2
|
|
0 commit comments