Skip to content

🔧 Assign PR to author #10

🔧 Assign PR to author

🔧 Assign PR to author #10

name: Assign author to PR
on:
pull_request:
permissions:
issues: write
pull-requests: write
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
jobs:
assign-author-to-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
const author = context.payload.pull_request.user.login;
const result = await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
assignee: [author],
});
core.debug(JSON.stringify(result));
core.info(`@${author} has been assigned to the pull request: #${context.issue.number}`);