label_external_issues.yml 707 B

12345678910111213141516171819202122
  1. name: Label issue from external users
  2. on:
  3. issues:
  4. types: [opened]
  5. jobs:
  6. label-external-issues:
  7. name: Label issue from external user
  8. runs-on: ubuntu-latest
  9. # https://docs.github.com/en/graphql/reference/enums#commentauthorassociation
  10. if: ${{ !contains(fromJson('["MEMBER", "OWNER", "COLLABORATOR"]'), github.event.issue.author_association) }}
  11. steps:
  12. - name: add external label
  13. uses: actions/github-script@v7
  14. with:
  15. script: |
  16. github.rest.issues.addLabels({
  17. issue_number: context.issue.number,
  18. owner: context.repo.owner,
  19. repo: context.repo.repo,
  20. labels: ['external']
  21. })