Skip to content

Commit

Permalink
Skip release on initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Schwarz <[email protected]>
  • Loading branch information
rswrz committed Jan 16, 2025
1 parent 3950194 commit e21de6a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/module-github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:
inputs:
run_job_project:
description: 'run project job'
description: "run project job"
default: true
type: boolean

Expand All @@ -17,5 +17,9 @@ jobs:
if: github.event_name == 'pull_request'
uses: ./.github/workflows/module-github-pull-request.yaml
release:
if: github.event_name == 'push' && github.ref_name == 'main'
# If the push event triggering this workflow is the first commit on a branch,
# `github.event.before` will always be "0000000000000000000000000000000000000000".
# With this knowledge, we can skip the release process on the initial commit,
# which is handled by CI during repository bootstrapping.
if: github.event_name == 'push' && github.ref_name == 'main' && github.event.before != '0000000000000000000000000000000000000000'
uses: ./.github/workflows/module-github-release.yaml

0 comments on commit e21de6a

Please sign in to comment.