Skip to content

Assign PR Author (on GitHub-hosted) #143

Assign PR Author (on GitHub-hosted)

Assign PR Author (on GitHub-hosted) #143

Workflow file for this run

name: Assign PR to author
run-name: Assign PR Author ${{ (vars.RUNS_ON_SELF_HOSTED == null && '(on GitHub-hosted)') || '(on self-hosted)' }}
on:
pull_request:
types: opened
defaults:
run:
shell: bash -euo pipefail {0}
jobs:
pr-assign:
runs-on: ${{ (vars.RUNS_ON_SELF_HOSTED == null && 'ubuntu-latest') || 'self-hosted' }}
permissions:
contents: read
pull-requests: write
repository-projects: read
if: ${{ !contains(github.actor, '[bot]') }}
timeout-minutes: 30
steps:
- uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
id: app-token
with:
app-id: ${{ secrets.APPS_APP_ID }}
private-key: ${{ secrets.APPS_PRIVATE_KEY }}
- env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: >
gh pr edit ${{ github.event.number }}
--add-assignee ${{ github.actor }}
--repo ${{ github.repository }}