Skip to content

feat(RequiredExactlyOne): Add RequiredExactlyOne #35

feat(RequiredExactlyOne): Add RequiredExactlyOne

feat(RequiredExactlyOne): Add RequiredExactlyOne #35

Workflow file for this run

name: 'Add assignee'
on:
pull_request:
types: [opened, ready_for_review]
branches:
- 'main'
jobs:
add-assignee:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Add Assignee to Pull Request
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
try {
const { data: pull } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
});
console.log(pull);
if (!pull.assignees || pull.assignees.length === 0) {
await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
assignees: [context.actor],
});
}
} catch (error) {
throw new Error(`Check this error >>> ${error.message}`);
}