Skip to content

Commit

Permalink
Update assign-reviewers.yml workflow***
Browse files Browse the repository at this point in the history
This commit updates the assign-reviewers.yml workflow file. It replaces the deprecated 'actions/checkout@v3' with 'actions/checkout@v4' and modifies the 'Approve and Merge PR' step to extract the PR number from the URL. This ensures compatibility with the latest GitHub Actions and improves the workflow's functionality.
  • Loading branch information
thefourcraft committed Mar 15, 2024
1 parent c7c5ea5 commit aa2c1ed
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/assign-reviewers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ jobs:
runs-on: ubuntu-latest
if: github.event.issue.pull_request && contains(github.event.comment.body, '✅')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

- name: Approve and Merge PR
if: contains(fromJson('["TickerDev", "thefourcraft"]'), github.event.comment.user.login)
run: |
gh pr review "${{ github.event.issue.pull_request.url }}" --approve
gh pr merge "${{ github.event.issue.pull_request.url }}" --merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Approve and Merge PR
if: contains(fromJson('["TickerDev", "thefourcraft"]'), github.event.comment.user.login)
run: |
PR_NUMBER=$(echo "${{ github.event.issue.pull_request.url }}" | grep -oP '(?<=pulls/)\d+')
gh pr review "$PR_NUMBER" --approve
gh pr merge "$PR_NUMBER" --merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit aa2c1ed

Please sign in to comment.