forked from SatelliteQE/robottelo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Github Action to Automatically assign T2 Reviewers to framework touched PRs | ||
name: Auto assign T2 Reviewers | ||
|
||
on: | ||
pull_request: | ||
paths: ['.github/**'] | ||
|
||
env: | ||
NUMBER: ${{ github.event.number }} | ||
REVIEWERS: "robottelo-tier-2-reviewers" | ||
LABELS: "Framework Changes" | ||
SATQE_TOKEN: ${{ secrets.CHERRYPICK_PAT }} | ||
|
||
jobs: | ||
assign-reviewers-and-labels: | ||
name: Assign T2 Reviewers and Labels to the PR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Add Labels to the PR | ||
run: | | ||
echo "Adding applicable labels to the PR $NUMBER" | ||
curl -L -X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $SATQE_TOKEN" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/jyejare/robottelo/issues/$NUMBER/labels \ | ||
-d '{"labels": ["$LABELS"]}' | ||
- name: Assign T2 Reviewers Team to the PR | ||
run: | | ||
echo "Assigning T2 Reviewers to the PR $number" | ||
curl -L \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $SATQE_TOKEN" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/jyejare/robottelo/pulls/$NUMBER/requested_reviewers \ | ||
-d '{"team_reviewers": ["$REVIEWERS"]}' |