Skip to content

Commit

Permalink
Only attempt to commit if the version files have changed locally
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcollom committed Nov 17, 2023
1 parent 73b48be commit b83a0a7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,35 @@ jobs:
replace: "${{steps.release_number.outputs.substring}}"
include: "deploy/yaml/deploy.yaml"
regex: true
- name: Fid and Replace Makefile versions
- name: Find and Replace Makefile versions
uses: jacobtomlinson/gha-find-replace@v3
with:
find: 'v(\d+)\.(\d+)\.(\d+)(-rc(\d)+)?'
replace: "${{steps.release_number.outputs.substring}}"
include: "Makefile"
regex: true

- name: Detect any Local Changes
uses: dorny/paths-filter@v2
id: filter
with:
base: HEAD
filters: |
versions:
- 'Makefile'
- 'deploy/yaml/deploy.yaml'
- 'deploy/charts/version-checker/Chart.yaml'
- name: Commit files
if: steps.filter.outputs.versions == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git status
git commit -a -m "Bump versions to ${{steps.release_number.outputs.substring}} "
- name: Push changes
if: steps.filter.outputs.versions == 'true'
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit b83a0a7

Please sign in to comment.