Skip to content

Commit

Permalink
ci: Add watchdog
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Koenig <okoenig@nvidia.com>
  • Loading branch information
ko3n1g committed May 7, 2024
1 parent 617e378 commit ca5bd7b
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/_watchdog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: watchdog

on:
issue_comment:
types: [created]

jobs:
woof:
runs-on: ubuntu-22.04
if: >
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/ci')
steps:
- name: Get PR number
shell: bash
id: get-pr-num
run: |
PR_URL="${{ github.event.issue.pull_request.url }}"
PR_NUM=${PR_URL##*/}
echo "pr_number=$PR_NUM" >> $GITHUB_OUTPUT
- name: Get Pull Request Information
uses: actions/github-script@v6
id: get-pr-branch
with:
result-encoding: string
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: ${{ steps.get-pr-num.outputs.pr_number }}
});
console.log('Pull Request Information:', pr.data);
return pr.data.head.ref;
- name: Workflow Dispatch and wait
uses: aurelien-baudet/workflow-dispatch@v2.1.1
with:
workflow: "CI"
token: ${{ secrets.TOKEN }}
wait-for-completion: false
ref: ${{ steps.get-pr-branch.outputs.result }}

0 comments on commit ca5bd7b

Please sign in to comment.