Skip to content

Commit b946316

Browse files
authored
chore: try github app (#16)
1 parent df7a52d commit b946316

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

.github/workflows/bump.app.version.yml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,18 @@ jobs:
1515
name: Checkout
1616
runs-on: ubuntu-latest
1717
steps:
18+
- uses: actions/create-github-app-token@v1
19+
id: merge-app-token
20+
with:
21+
app-id: ${{ vars.MERGE_APP_ID }}
22+
private-key: ${{ secrets.MERGE_APP_SECRET }}
1823
- uses: actions/checkout@v3
1924
- uses: actions/setup-node@v3
2025
with:
2126
node-version: 18.x
2227
cache: yarn
2328
cache-dependency-path: '**/yarn.lock'
29+
token: ${{ steps.merge-app-token.outputs.token }}
2430

2531
- name: Ensure that we are running on `main`
2632
if: github.ref != 'refs/heads/main'
@@ -73,23 +79,7 @@ jobs:
7379
run: |
7480
git config user.name "github-actions"
7581
git config user.email "github-actions@github.com"
76-
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}
7782
git add versions.json
78-
git commit -m "chore: update app version to ${{ steps.set-app-version.outputs.new_app_version }}"
79-
git rebase --origin main
80-
git push
81-
82-
#BRANCH_NAME="bump-app-version-${{ github.run_id }}"
83-
#git checkout -b "$BRANCH_NAME"
84-
85-
#git add versions.json
86-
#git commit -m "chore: update app version to ${{ steps.set-app-version.outputs.new_app_version }}"
87-
#git push origin "$BRANCH_NAME"
88-
89-
## Create and auto-merge PR
90-
#gh pr create --title "chore: bump app version to ${{ steps.set-app-version.outputs.new_app_version }}" \
91-
# --body "This PR was auto-generated by GitHub Actions." \
92-
# --base main \
93-
# --head "$BRANCH_NAME"
94-
#
95-
#gh pr merge "$BRANCH_NAME" --auto --squash --delete-branch
83+
git commit -m "chore: bump app version to ${{ steps.set-app-version.outputs.new-app_version }}"
84+
git pull --rebase origin main
85+
git push origin "$BRANCH_NAME"

0 commit comments

Comments
 (0)