ok-to-test-managed.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # If someone with write access comments "/ok-to-test-managed" on a pull request, emit a repository_dispatch event
  2. name: Ok To Test
  3. on:
  4. issue_comment:
  5. types: [created]
  6. permissions:
  7. contents: read
  8. jobs:
  9. ok-to-test-managed:
  10. permissions:
  11. pull-requests: write # for peter-evans/slash-command-dispatch to create PR reaction
  12. runs-on: ubuntu-latest
  13. # Only run for PRs, not issue comments
  14. if: ${{ github.event.issue.pull_request }}
  15. steps:
  16. # Generate a GitHub App installation access token from an App ID and private key
  17. # To create a new GitHub App:
  18. # https://developer.github.com/apps/building-github-apps/creating-a-github-app/
  19. # See app.yml for an example app manifest
  20. - name: Generate token
  21. id: generate_token
  22. uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
  23. with:
  24. app_id: ${{ secrets.APP_ID }}
  25. private_key: ${{ secrets.PRIVATE_KEY }}
  26. - name: Slash Command Dispatch
  27. uses: peter-evans/slash-command-dispatch@f996d7b7aae9059759ac55e978cff76d91853301 # v3.0.2
  28. env:
  29. TOKEN: ${{ steps.generate_token.outputs.token }}
  30. with:
  31. token: ${{ env.TOKEN }} # GitHub App installation access token
  32. # token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # PAT or OAuth token will also work
  33. reaction-token: ${{ secrets.GITHUB_TOKEN }}
  34. issue-type: pull-request
  35. commands: ok-to-test-managed
  36. permission: maintain