Skip to content

Commit

Permalink
update gh-release to cancel run and not fail it
Browse files Browse the repository at this point in the history
  • Loading branch information
Calychas committed Nov 22, 2023
1 parent 3e54565 commit b13e107
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
types:
- completed

permissions:
actions: 'write'

jobs:
github-release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
Expand All @@ -18,8 +21,11 @@ jobs:
- name: Get last commit message
id: get-last-commit-message
run: echo COMMIT_MESSAGE="$(git log -1 --pretty=%B | cat)" >> "$GITHUB_OUTPUT"
- name: Check commit message for release info
run: ${{ contains(steps.get-last-commit-message.outputs.COMMIT_MESSAGE, format('chore(CI/CD){0} bump version', ':')) }}
- name: Cancel run if not a release commit
run: |
(${{ contains(steps.get-last-commit-message.outputs.COMMIT_MESSAGE, format('chore(CI/CD){0} bump version', ':')) }} &&
gh run cancel ${{ github.run_id }} &&
gh run watch ${{ github.run_id }}) || true
- name: Configure Git user
run: |
git config --local user.name "Kraina CI/CD"
Expand Down

0 comments on commit b13e107

Please sign in to comment.