Skip to content

Use dedicated token for pr assignment #1751

Use dedicated token for pr assignment

Use dedicated token for pr assignment #1751

Workflow file for this run

name: Assign PR to author and reviewers
# This workflow runs on the pull_request_target event:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
#
# So the secrets are accessible even if the PR was opened from an external
# repository. This is done because the GitHub API key needs to be accessed
# to modify the PRs.
#
# NOTE: Only API calls should be made in the actions defined here. The
# committed code should _NOT_ be touched in any case.
"on":
pull_request_target:
types: [ opened, reopened, ready_for_review ]
jobs:
assign-pr:
name: Assign PR to author
# 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: 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}"