ci: rename default branch from master to main
Problem: the fork used master as the default branch name. Solution: rename to main and update all CI workflow triggers, ref checks, and the pre-push hook fallback.
This commit is contained in:
parent
4ab4765a84
commit
42af6caf0a
2 changed files with 5 additions and 6 deletions
2
.github/pre-push
vendored
2
.github/pre-push
vendored
|
|
@ -2,7 +2,7 @@
|
||||||
set -e
|
set -e
|
||||||
IFS=' '
|
IFS=' '
|
||||||
while read local_ref _local_sha _remote_ref _remote_sha; do
|
while read local_ref _local_sha _remote_ref _remote_sha; do
|
||||||
remote_main=$( (git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null || echo "///master") | cut -f 4 -d / | tr -d "[:space:]")
|
remote_main=$( (git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null || echo "///main") | cut -f 4 -d / | tr -d "[:space:]")
|
||||||
local_ref_short=$(echo "$local_ref" | cut -f 3 -d / | tr -d "[:space:]")
|
local_ref_short=$(echo "$local_ref" | cut -f 3 -d / | tr -d "[:space:]")
|
||||||
if [ "$local_ref_short" = "$remote_main" ]; then
|
if [ "$local_ref_short" = "$remote_main" ]; then
|
||||||
make lint
|
make lint
|
||||||
|
|
|
||||||
9
.github/workflows/tests.yml
vendored
9
.github/workflows/tests.yml
vendored
|
|
@ -3,11 +3,10 @@ name: Tests
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
- stevearc-*
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
luacheck:
|
luacheck:
|
||||||
|
|
@ -86,7 +85,7 @@ jobs:
|
||||||
python -m pip install pyparsing==3.0.9
|
python -m pip install pyparsing==3.0.9
|
||||||
make doc
|
make doc
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
COMMIT_MSG: |
|
COMMIT_MSG: |
|
||||||
|
|
@ -103,7 +102,7 @@ jobs:
|
||||||
release:
|
release:
|
||||||
name: release
|
name: release
|
||||||
|
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
needs:
|
needs:
|
||||||
- luacheck
|
- luacheck
|
||||||
- stylua
|
- stylua
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue