mirror of
https://github.com/google/blockly.git
synced 2026-01-07 09:00:11 +01:00
* chore: add and configure prettier * chore: remove clang-format * chore: remove clang-format config * chore: lint additional ts files * chore: fix lint errors in blocks * chore: add prettier-ignore where needed * chore: ignore js blocks when formatting * chore: fix playground html syntax * chore: fix yaml spacing from merge * chore: convert text blocks to use arrow functions * chore: format everything with prettier * chore: fix lint unused imports in blocks
42 lines
1.5 KiB
YAML
42 lines
1.5 KiB
YAML
name: Assign requested reviewers
|
|
|
|
# This workflow adds requested reviewers as assignees. If you remove a
|
|
# requested reviewer, it will not remove them as an assignee.
|
|
#
|
|
# See https://github.com/google/blockly/issues/5643 for more
|
|
# information on why this was added.
|
|
#
|
|
# N.B.: Runs with a read-write repo token. Do not check out the
|
|
# submitted branch!
|
|
on:
|
|
pull_request_target:
|
|
types: [review_requested]
|
|
|
|
jobs:
|
|
requested-reviewer:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Assign requested reviewer
|
|
uses: actions/github-script@v6
|
|
with:
|
|
script: |
|
|
try {
|
|
if (context.payload.pull_request === undefined) {
|
|
throw new Error("Can't get pull_request payload. " +
|
|
'Check a request reviewer event was triggered.');
|
|
}
|
|
const reviewers = context.payload.pull_request.requested_reviewers;
|
|
// Assignees takes in a list of logins rather than the
|
|
// reviewer object.
|
|
const reviewerNames = reviewers.map(reviewer => reviewer.login);
|
|
const {number:issue_number} = context.payload.pull_request;
|
|
github.rest.issues.addAssignees({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: issue_number,
|
|
assignees: reviewerNames
|
|
});
|
|
} catch (error) {
|
|
core.setFailed(error.message);
|
|
}
|