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 5c803f2
Show file tree
Hide file tree
Showing 2 changed files with 28 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

43 changes: 24 additions & 19 deletions .github/workflows/pr-handling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,32 @@ 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/[email protected]
# - uses: kentaro-m/[email protected]
- uses: delivery-much/actions-assigner@v1
with:
token: ${{ secrets.ORG_AUTOMATION_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}"
# 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 5c803f2

Please sign in to comment.