Skip to content

Commit 580d71a

Browse files
authored
Replace main with default branch in update.yml (#6)
1 parent f40cb17 commit 580d71a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/update.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ jobs:
77
update-and-create-pr:
88
runs-on: ubuntu-latest
99

10+
env:
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
DEFAULT_BRANCH: ""
13+
1014
steps:
1115
- name: Checkout repository
1216
uses: actions/checkout@v4
@@ -23,7 +27,10 @@ jobs:
2327
run: |
2428
git config user.name "github-actions[bot]"
2529
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
26-
30+
31+
- name: Get default branch
32+
run: echo "DEFAULT_BRANCH=$(gh api repos/${{ github.repository }} --jq .default_branch)" >> $GITHUB_ENV
33+
2734
- name: Commit changes to a new branch
2835
run: |
2936
git checkout -b changes/${{ github.run_id }}
@@ -32,7 +39,5 @@ jobs:
3239
git push -u origin changes/${{ github.run_id }}
3340
3441
- name: Create Pull Request
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3742
run: |
38-
gh pr create --base main --head changes/${{ github.run_id }} --title "Specify project URLs and CMake project" --body "Please review the changes applied by the automated script."
43+
gh pr create --base $DEFAULT_BRANCH --head changes/${{ github.run_id }} --title "Specify project URLs and CMake project" --body "Please review the changes applied by the automated script."

0 commit comments

Comments
 (0)