Skip to content

Commit

Permalink
Use dedicated token for pr assignment
Browse files Browse the repository at this point in the history
Since changing the default permissions of the GITHUB_TOKEN this
workflow was failing with insufficient permissions.
  • Loading branch information
svenklemm committed Jun 19, 2024
1 parent 42a12ee commit 310822a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
4 changes: 4 additions & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

addReviewers: false
addAssignees: author

40 changes: 21 additions & 19 deletions .github/workflows/pr-handling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,29 @@ name: Assign PR to author and reviewers
types: [ opened, reopened, ready_for_review ]

jobs:

assign-pr:
name: Assign PR to author
permissions:
contents: write
permissions: write-all
# contents: read # for kentaro-m/auto-assign-action to fetch config file
# pull-requests: write # for kentaro-m/auto-assign-action to assign PR reviewers
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@v2.1.0
- uses: kentaro-m/auto-assign[email protected]

ask-review:
name: Run pull-review
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v4
- name: Run pull-review with docker
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
PULL_REQUEST_NUMBER : ${{ github.event.pull_request.number }}
shell: bash
run: |
PR_URL="https://github.com/${OWNER}/${REPO}/pull/${PULL_REQUEST_NUMBER}"
docker run ghcr.io/imsky/pull-review "$PR_URL" --github-token "${GITHUB_TOKEN}"
# ask-review:
# name: Run pull-review
# runs-on: ubuntu-latest
# if: ${{ !github.event.pull_request.draft }}
# steps:
# - uses: actions/checkout@v4
# - name: Run pull-review with docker
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# OWNER: ${{ github.repository_owner }}
# REPO: ${{ github.event.repository.name }}
# PULL_REQUEST_NUMBER : ${{ github.event.pull_request.number }}
# shell: bash
# run: |
# PR_URL="https://github.com/${OWNER}/${REPO}/pull/${PULL_REQUEST_NUMBER}"
# docker run ghcr.io/imsky/pull-review "$PR_URL" --github-token "${GITHUB_TOKEN}"

0 comments on commit 310822a

Please sign in to comment.