Skip to content

Commit 9901f1f

Browse files
authored
Merge pull request #72 from nodenv/rename-master-main
Create sync-default-branch.yml
2 parents 97f867d + 5227ed1 commit 9901f1f

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Sync Default Branch
2+
on:
3+
push: { branches: main }
4+
workflow_dispatch:
5+
6+
# One-time commands for users to switch-over:
7+
#
8+
# ```console
9+
# git branch -m master main
10+
# git fetch origin
11+
# git branch -u origin/main main
12+
# git remote set-head origin -a
13+
# ```
14+
15+
jobs:
16+
sync:
17+
permissions: { contents: write }
18+
uses: nodenv/.github/.github/workflows/sync-default-branch.yml@v4

script/lts-lint-definitions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ lts_WARNING="before_install_package() {\\
4141
"
4242

4343
schedule_json() {
44-
curl -qsSfJL https://raw.githubusercontent.com/nodejs/Release/master/schedule.json
44+
curl -qsSfJL https://raw.githubusercontent.com/nodejs/Release/main/schedule.json
4545
}
4646

4747
# Flattens the LTS schedule.json into bash variables:

script/submit-definitions

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ done
4646
# This returns 'HEAD' if in detached HEAD state. Useless in that case.
4747
orig_branch=$(git rev-parse --abbrev-ref HEAD)
4848

49-
git fetch --quiet --unshallow "$origin" master 2>/dev/null || git fetch --quiet "$origin" master
50-
git checkout --quiet -B latest-scraped-definitions "$origin"/master
49+
git fetch --quiet --unshallow "$origin" main 2>/dev/null || git fetch --quiet "$origin" master
50+
git checkout --quiet -B latest-scraped-definitions "$origin"/main
5151

52-
npm run-script scrape-definitions
53-
npm run-script commit-definitions
52+
npm run scrape-definitions
53+
npm run commit-definitions
5454
hub pull-request
5555

5656
git checkout --quiet "$orig_branch"

0 commit comments

Comments
 (0)