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 8771fc7 commit 6d47ec1
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/create-token-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,14 @@ jobs:
- name: Check PR Branch
id: git-branch
run: |
if git branch --list "$PR_BRANCH"; then
echo "pr_branch=true" >> $GITHUB_OUTPUT
else
echo "pr_branch=false" >> $GITHUB_OUTPUT
fi
GIT_BRANCH="$(git branch -l $PR_BRANCH)"
echo "pr_branch=${GIT_BRANCH}" >> $GITHUB_OUTPUT
env:
PR_BRANCH: ${{ steps.branch-names.outputs.pr-branch }}

# if the branch already exits, update the PR
- name: Update Branch
if: steps.git-branch.outputs.pr_branch == 'true'
if: steps.git-branch.outputs.pr_branch != ''
run: |
git checkout $PR_BRANCH
git merge ${{ github.ref_name }} -X theirs --no-edit
Expand All @@ -50,10 +47,10 @@ jobs:

# if the branch does not exit, create the PR
- name: Create PR
if: steps.git-branch.outputs.pr_branch == 'false'
if: steps.git-branch.outputs.pr_branch == ''
run: |
git checkout -b $PR_BRANCH ${{ github.ref_name }}
gh pr create --title "chore(tokens): :art: update tokens" --body "Merge this PR to update the tokens in the main branch." --base main --head $PR_BRANCH
gh pr create --title "chore(tokens): :art: update tokens" --body "Merge this PR to update the tokens in the main branch." --base main
env:
PR_BRANCH: ${{ steps.branch-names.outputs.pr-branch }}
GITHUB_TOKEN: ${{ secrets.SWISSPOSTDEVS_ACCESS_TOKEN }}

0 comments on commit 6d47ec1

Please sign in to comment.