Skip to content

Commit

Permalink
fix: Specify correct branch names in CI and PR workflows
Browse files Browse the repository at this point in the history
1. pull request events are "funny", so we need to check out using `github.event.pull_request.head.ref` if the workflow step will commit anything. See actions/checkout#317 (comment)
2. Regular push events just check out the regular branch, but if this is enabled on multiple branches we need the ability to get the branch name dynamically. Use the new `GITHUB_REF_NAME` variable.
  • Loading branch information
michaelborn committed Nov 9, 2021
1 parent 2c55c6c commit e034228
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
githubToken: ${{ secrets.GH_TOKEN }}
excludeCommit: ${{ github.event.head_commit.message }}
forgeboxToken: ${{ secrets.FORGEBOX_TOKEN }}
branch: master
branch: ${ GITHUB_REF_NAME }
plugins: '{ "VerifyConditions": "GitHubActionsConditionsVerifier@commandbox-semantic-release", "FetchLastRelease": "ForgeBoxReleaseFetcher@commandbox-semantic-release", "RetrieveCommits": "JGitCommitsRetriever@commandbox-semantic-release", "ParseCommit": "EmojiLogCommitParser@commandbox-semantic-release", "FilterCommits": "DefaultCommitFilterer@commandbox-semantic-release", "AnalyzeCommits": "DefaultCommitAnalyzer@commandbox-semantic-release", "VerifyRelease": "NullReleaseVerifier@commandbox-semantic-release", "GenerateNotes": "GitHubMarkdownNotesGenerator@commandbox-semantic-release", "UpdateChangelog": "FileAppendChangelogUpdater@commandbox-semantic-release", "CommitArtifacts": "GitHubArtifactsCommitter@commandbox-semantic-release", "PublishRelease": "ForgeBoxReleasePublisher@commandbox-semantic-release", "PublicizeRelease": "GitHubReleasePublicizer@commandbox-semantic-release" }'

- name: Inform Slack
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
ref: ${{ github.event.pull_request.head.ref }}

- uses: Ortus-Solutions/commandbox-action@v1
with:
Expand Down

0 comments on commit e034228

Please sign in to comment.