Skip to content

Commit 73d6dd6

Browse files
authored
build(ci): only validate branch name on pull request (#6190)
## Problem It appears that on `push` events the `head_ref` is an empty string, which is not a valid branch name. ## Solution - Only validate branch names on pull_request events, and use event info since its more consistent. --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent e300353 commit 73d6dd6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/node.js.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ jobs:
3232
- uses: actions/setup-node@v4
3333
with:
3434
node-version: '20'
35-
- name: Check Branch title
35+
- name: Validate Branch name
36+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref != ''}}
3637
env:
37-
BRANCH_NAME: ${{ github.head_ref }}
38+
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
3839
run: |
3940
node "$GITHUB_WORKSPACE/.github/workflows/lintbranch.js" run "$BRANCH_NAME"
4041
- name: Check PR title

0 commit comments

Comments
 (0)