ok-to-test-managed.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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. jobs:
  7. ok-to-test-managed:
  8. runs-on: ubuntu-latest
  9. # Only run for PRs, not issue comments
  10. if: ${{ github.event.issue.pull_request }}
  11. steps:
  12. # Generate a GitHub App installation access token from an App ID and private key
  13. # To create a new GitHub App:
  14. # https://developer.github.com/apps/building-github-apps/creating-a-github-app/
  15. # See app.yml for an example app manifest
  16. - name: Generate token
  17. id: generate_token
  18. uses: tibdex/github-app-token@v1
  19. with:
  20. app_id: ${{ secrets.APP_ID }}
  21. private_key: ${{ secrets.PRIVATE_KEY }}
  22. - name: Slash Command Dispatch
  23. uses: peter-evans/slash-command-dispatch@v3
  24. env:
  25. TOKEN: ${{ steps.generate_token.outputs.token }}
  26. with:
  27. token: ${{ env.TOKEN }} # GitHub App installation access token
  28. # token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # PAT or OAuth token will also work
  29. reaction-token: ${{ secrets.GITHUB_TOKEN }}
  30. issue-type: pull-request
  31. commands: ok-to-test-managed
  32. permission: maintain