Skip to content

smaller job defaults requirements #1309

smaller job defaults requirements

smaller job defaults requirements #1309

name: Trigger on Comment
on:
issue_comment:
types: [created, edited]
jobs:
trigger-workflows:
if: github.event.issue.pull_request && contains(github.event.comment.body, '/oktotest')
runs-on: ubuntu-latest
steps:
- name: Check if commenter is authorized
id: check-authorization
shell: bash
run: |
set -euo pipefail
COMMENTER=$(jq --raw-output .comment.user.login "$GITHUB_EVENT_PATH")
APPROVERS=$(yq e '.approvers[]' OWNERS)
if echo "$APPROVERS" | grep -Fxq "$COMMENTER"; then
echo "::set-output name=authorized::true"
else
echo "::set-output name=authorized::false"
fi
- name: Dispatch event
if: steps.check-authorization.outputs.authorized == 'true'
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: ok-to-test