Skip to content

Commit

Permalink
build: using custom token for push
Browse files Browse the repository at this point in the history
  • Loading branch information
manchuck committed May 22, 2024
1 parent 1ec0214 commit b03fa86
Showing 1 changed file with 43 additions and 25 deletions.
68 changes: 43 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
- edited
- released

env:
GH_TOKEN: ${{ secrets.GH_WIKI_PERSONAL_ACCESS_TOKEN }}

jobs:
test-action:
runs-on: ubuntu-latest
Expand All @@ -19,6 +22,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: '3.x'
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup node
uses: actions/setup-node@v3
Expand All @@ -28,29 +32,43 @@ jobs:
- name: Update RELEASES.MD
uses: vonage/[email protected]

- name: Release PR
id: releasepr
uses: peter-evans/create-pull-request@v6
with:
add-paths: RELEASES.md
commit-message: 'chore: updating release log'
title: 'chore: updating release log'
delete-branch: true
branch: 'release-log'
base: '3.x'

- name: Debug
run: echo ${{ steps.releasepr.outputs.pull-request-number }}

- name: Approve PR
uses: juliangruber/approve-pull-request-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.releasepr.outputs.pull-request-number }}
- name: GH_TOKEN
if: env.GH_TOKEN == ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV

- name: Merge PR
uses: juliangruber/merge-pull-request-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
merge-method: squash
pr: ${{ steps.releasepr.outputs.pull-request-number }}
- name: changelog
run: |
git config --local user.name github-actions
git config --local user.email [email protected]
git add RELEASES.md
git commit -m "chore: updated release log"
git push --force
# - name: Release PR
# id: releasepr
# uses: peter-evans/create-pull-request@v6
# with:
# add-paths: RELEASES.md
# commit-message: 'chore: updating release log'
# title: 'chore: updating release log'
# delete-branch: true
# branch: 'release-log'
# base: '3.x'
#
# - name: Debug
# run: echo ${{ steps.releasepr.outputs.pull-request-number }}
#
# - name: Approve PR
# uses: juliangruber/approve-pull-request-action@v2
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# number: ${{ steps.releasepr.outputs.pull-request-number }}
#
# - name: Merge PR
# uses: juliangruber/merge-pull-request-action@v1
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# merge-method: squash
# pr: ${{ steps.releasepr.outputs.pull-request-number }}

0 comments on commit b03fa86

Please sign in to comment.