Skip to content

Commit

Permalink
Update create-token-pr.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
alizedebray committed Oct 16, 2024
1 parent 5cd0960 commit d586d1b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/create-token-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ jobs:

steps:
# Checkout the token branch which was pushed
- name: Checkout
- name: Checkout Token Branch
uses: actions/checkout@v4
with:
fetch-depth: 0

# Check if the PR branch corresponding to the token branch exists
- name: Get PR Branch
Expand All @@ -32,17 +34,19 @@ jobs:
echo "exists=false" >> $GITHUB_OUTPUT
fi
# if the branch exits, update the PR
- name: Update PR
# If the branch exits, update the PR
- name: Update PR
if: steps.pr-branch.outputs.exists == 'true'
run: |
gh pr edit ${{ steps.pr-branch.outputs.name }} --base ${{ github.ref_name }}
gh pr update-branch ${{ steps.pr-branch.outputs.name }}
gh pr edit ${{ steps.pr-branch.outputs.name }} --base main
git config user.name "Swiss Post Bot"
git config user.email "[email protected]"
git checkout ${{ steps.pr-branch.outputs.name }}
git merge ${{ github.ref_name }} -X theirs --no-edit
git push
env:
GITHUB_TOKEN: ${{ secrets.SWISSPOSTDEVS_ACCESS_TOKEN }}

# if the branch does not exit, create the PR
# If the branch does not exit, create the PR
- name: Create PR
if: steps.pr-branch.outputs.exists == 'false'
run: |
Expand Down

0 comments on commit d586d1b

Please sign in to comment.