-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trigger the run-osp-extended-tests action on specific comment
Signed-off-by: Evgeny Slutsky <eslutsky@redhat.com>
- Loading branch information
Showing
2 changed files
with
108 additions
and
4 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,39 @@ | ||
name: new PR greeter | ||
on: | ||
pull_request_target: | ||
types: [opened,reopened] | ||
|
||
jobs: | ||
new_pr_greeter: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Checkout forklift | ||
uses: actions/checkout@v3 | ||
|
||
- id: codeowner | ||
uses: SvanBoxel/codeowners-action@v1 | ||
with: | ||
path: './.github/CODEOWNERS' | ||
|
||
- name: fail if the commenter doesnt exists in codeowners | ||
id: allowedaccess | ||
run: | | ||
echo allowed=$(echo '${{ steps.codeowner.outputs.codeowners }}' | \ | ||
jq -r '."tests/" | index("@${{ github.actor }}")') >> $GITHUB_OUTPUT | ||
- name: Add comment to PR | ||
uses: actions/github-script@v6 | ||
if: ${{ steps.allowedaccess.outputs.allowed == '1' }} | ||
with: | ||
script: | | ||
const body = `Welcome ${{ github.actor }}, you can run extended openstack test with **/test-osp-extended** comment`; | ||
await github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: body | ||
}) |
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