Skip to content

Commit

Permalink
[Hotfix] Correct the script (#60)
Browse files Browse the repository at this point in the history
* Correct the git merge command

* Add GITHUB_TOKEN to env

* Make the script executable

* Delete the comment
  • Loading branch information
sinsukehlab authored Jan 16, 2024
1 parent 420fa7a commit cb89324
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/script/merge-branch.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/4-add-branch-protections.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb89324

Please sign in to comment.