Skip to content

Commit

Permalink
chore: prevent jobs from running on skip release
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Aug 14, 2024
1 parent f0a2b75 commit 57d94b3
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
PR_TITLE: ${{ format('Direct push to {0}', github.ref_name) }}

call-workflow-e2e-prod:
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip release]')}}
needs: [build, lint, test, setup-matrix]
uses: dhis2/workflows/.github/workflows/analytics-e2e-tests-prod.yml@master
with:
Expand All @@ -102,7 +102,11 @@ jobs:
release:
runs-on: ubuntu-latest
needs: call-workflow-e2e-prod
if: ${{ !github.event.push.repository.fork && github.actor != 'dependabot[bot]' }}
if: >
${{ !github.event.push.repository.fork &&
github.actor != 'dependabot[bot]' &&
!contains(github.event.head_commit.message, '[skip ci]') &&
!contains(github.event.head_commit.message, '[skip release]') }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -115,6 +119,7 @@ jobs:
- name: Install
run: yarn install --frozen-lockfile

# This step will push a new commit to master with [skip release] in the commit message
- name: Run Semantic Release
run: npx semantic-release
env:
Expand All @@ -125,7 +130,12 @@ jobs:

report-release-result:
runs-on: ubuntu-latest
needs: call-workflow-e2e-prod
needs: release
if: >
${{ !github.event.push.repository.fork &&
github.actor != 'dependabot[bot]' &&
!contains(github.event.head_commit.message, '[skip ci]') &&
!contains(github.event.head_commit.message, '[skip release]') }}
steps:
- name: Checkout code
uses: actions/checkout@master
Expand Down

0 comments on commit 57d94b3

Please sign in to comment.