feat(ExtractRouteParams): Add ExtractRouteParams
#11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`); | |
} |