Skip to content

Commit 1514885

Browse files
aduh95targos
authored andcommitted
tools: make GH Actions workflows work if default branch is not master
PR-URL: #38516 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Mary Marchini <oss@mmarchini.me>
1 parent 03b4a3a commit 1514885

11 files changed

+14
-6
lines changed

.github/workflows/build-tarball.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- master
8+
- main
89
- v[0-9]+.x-staging
910
- v[0-9]+.x
1011

.github/workflows/build-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- master
8+
- main
89
- canary
910
- v[0-9]+.x-staging
1011
- v[0-9]+.x

.github/workflows/commit-queue.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
# See https://github.com/nodejs/node-core-utils/pull/486
2929
fetch-depth: 0
3030
# A personal token is required because pushing with GITHUB_TOKEN will
31-
# prevent commits from running CI after they land on master. It needs
31+
# prevent commits from running CI after they land. It needs
3232
# to be set here because `checkout` configures GitHub authentication
3333
# for push as well.
3434
token: ${{ secrets.GH_USER_TOKEN }}
@@ -63,15 +63,13 @@ jobs:
6363
owner: ${{ env.OWNER }}
6464
repo: ${{ env.REPOSITORY }}
6565
# Commit queue is only enabled for the default branch on the repository
66-
# TODO(mmarchini): get the default branch programmatically instead of
67-
# assuming `master`
68-
base_ref: "master"
66+
base_ref: ${{ github.repository.default_branch }}
6967
env:
7068
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7169

7270
- name: Configure node-core-utils
7371
run: |
74-
ncu-config set branch master
72+
ncu-config set branch ${{ github.repository.default_branch }}
7573
ncu-config set upstream origin
7674
ncu-config set username "${{ secrets.GH_USER_NAME }}"
7775
ncu-config set token "${{ secrets.GH_USER_TOKEN }}"

.github/workflows/coverage-linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
push:
1111
branches:
1212
- master
13+
- main
1314
paths-ignore:
1415
- 'doc/**'
1516
- 'deps/**'

.github/workflows/coverage-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
push:
1111
branches:
1212
- master
13+
- main
1314
paths-ignore:
1415
- 'doc/**'
1516
- 'deps/**'

.github/workflows/linters.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- master
8+
- main
89
- v[0-9]+.x-staging
910
- v[0-9]+.x
1011

.github/workflows/misc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- master
8+
- main
89
- v[0-9]+.x-staging
910
- v[0-9]+.x
1011

.github/workflows/notify-force-push.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ on:
22
push:
33
branches:
44
- master
5+
- main
56

67
name: Notify on Force Push
78
jobs:
@@ -17,7 +18,7 @@ jobs:
1718
SLACK_ICON: https://github.com/nodejs.png?size=48
1819
SLACK_TITLE: '${{ github.actor }} force-pushed to ${{ github.ref }}'
1920
SLACK_MESSAGE: |
20-
A commit was force-pushed to <https://github.com/${{ github.repository }}/tree/master|${{ github.repository }}@master> by <https://github.com/${{ github.actor }}|${{ github.actor }}>
21+
A commit was force-pushed to <https://github.com/${{ github.repository }}/tree/${{ github.repository.default_branch }}|${{ github.repository }}@${{ github.repository.default_branch }}> by <https://github.com/${{ github.actor }}|${{ github.actor }}>
2122
2223
Before: <https://github.com/${{ github.repository }}/commit/${{ github.event.before }}|${{ github.event.before }}>
2324
After: <https://github.com/${{ github.repository }}/commit/${{ github.event.after }}|${{ github.event.after }}>

.github/workflows/test-asan.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- main
78
- canary
89
- v[0-9]+.x-staging
910
- v[0-9]+.x

.github/workflows/test-linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- master
8+
- main
89
- canary
910
- v[0-9]+.x-staging
1011
- v[0-9]+.x

.github/workflows/test-macos.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches:
99
- master
10+
- main
1011
- canary
1112
- v[0-9]+.x-staging
1213
- v[0-9]+.x

0 commit comments

Comments
 (0)