diff --git a/.github/script/merge-branch.sh b/.github/script/merge-branch.sh old mode 100644 new mode 100755 index 7cbacfd..2b88555 --- a/.github/script/merge-branch.sh +++ b/.github/script/merge-branch.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Make sure this file is executable -# chmod +x .github/script/merge-branch.sh +# chmod a+x .github/script/merge-branch.sh # USAGE: This script is used to merge a branch into another branch @@ -11,11 +11,11 @@ git config user.name github-actions git config user.email github-actions@github.com # Merge branch -echo "If branch $branch2 exists, merge branch origin $branch1 into branch $branch2" +echo "If branch $branch2 exists, merge branch $branch1 into branch $branch2" if git show-ref --quiet refs/heads/$branch2 then git checkout $branch2 - git merge origin $branch1 + git merge $branch1 git push origin $branch2 else echo "Branch $branch2 does not exist" diff --git a/.github/workflows/4-add-branch-protections.yml b/.github/workflows/4-add-branch-protections.yml index d1839b6..94327bd 100644 --- a/.github/workflows/4-add-branch-protections.yml +++ b/.github/workflows/4-add-branch-protections.yml @@ -56,13 +56,13 @@ jobs: fetch-depth: 0 # Let's get all the branches. ref: ci # Important, as normally `branch_protection_rule` event won't grab other branches - - name: Merge changes from origin main into ci + - name: Merge changes from origin/main into ci run: ./.github/script/merge-branch.sh env: - branch1: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + branch1: origin/main branch2: ci - # TODO: figure out a better way to deal with the merge conflict. # In README.md, switch step 4 for step 5. - name: Update to step 5 uses: skills/action-update-step@v2