name: Request NVSkills CI

on:
  issue_comment:
    types: [created]
  push:

jobs:
  request:
    if: >
      (github.event_name == 'issue_comment' &&
        github.event.issue.pull_request &&
        startsWith(github.event.comment.body, '/nvskills-ci')) ||
      (github.event_name == 'push' &&
        github.actor == (vars.NVSKILLS_SIGNATURE_PUSH_ACTOR || 'nv-skills-ci[bot]') &&
        startsWith(github.event.head_commit.message, vars.NVSKILLS_SIGNATURE_COMMIT_TITLE || 'Attach NVSkills validation signatures'))
    permissions:
      contents: read
      pull-requests: read
    uses: NVIDIA/skills/.github/workflows/team-request.yml@main
    secrets:
      NVSKILLS_CI_DISPATCH_TOKEN: ${{ secrets.NVSKILLS_CI_DISPATCH_TOKEN }}
