vouch-manage-by-discussion.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # vouch (https://github.com/mitchellh/vouch)
  2. name: Vouch - Manage by discussion
  3. on:
  4. discussion_comment:
  5. types: [created]
  6. permissions:
  7. contents: read
  8. discussions: write
  9. # Serialize updates to the VOUCHED file
  10. concurrency:
  11. group: vouch-manage
  12. cancel-in-progress: false
  13. queue: max
  14. jobs:
  15. manage:
  16. # Skip comments which can't contain a vouch command
  17. if: github.repository == 'netbox-community/netbox' && contains(github.event.comment.body, '!')
  18. runs-on: ubuntu-latest
  19. steps:
  20. # An app token is required to push the VOUCHED update to the protected default branch.
  21. - name: Create app token
  22. uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
  23. id: app-token
  24. with:
  25. app-id: 1076524
  26. private-key: ${{ secrets.HOUSEKEEPING_SECRET_KEY }}
  27. permission-contents: write
  28. - name: Check out repo
  29. uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  30. with:
  31. token: ${{ steps.app-token.outputs.token }}
  32. - name: Update VOUCHED file
  33. uses: mitchellh/vouch/action/manage-by-discussion@d66fa29a64600490892131ad87597c30c91fcac4 # v1.5.0
  34. with:
  35. discussion-number: ${{ github.event.discussion.number }}
  36. comment-node-id: ${{ github.event.comment.node_id }}
  37. vouch-keyword: "!vouch"
  38. denounce-keyword: "!denounce"
  39. unvouch-keyword: "!unvouch"
  40. roles: "admin,maintain,write"
  41. env:
  42. # Used for API calls (reading the comment, reacting to it); the push uses the app token from checkout
  43. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}