reusable-create-issue-for-failure.yml 772 B

123456789101112131415161718192021222324252627
  1. name: Reusable - Create issue for failure
  2. on:
  3. workflow_call:
  4. jobs:
  5. create-issue:
  6. name: Create issue
  7. runs-on: ubuntu-latest
  8. steps:
  9. - uses: actions/checkout@v3
  10. - name: Create issue
  11. env:
  12. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  13. run: |
  14. cat > body.txt << EOF
  15. [$GITHUB_WORKFLOW #$GITHUB_RUN_NUMBER](https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) failed.
  16. Please take a look and fix it ASAP.
  17. EOF
  18. gh issue create --title "$GITHUB_WORKFLOW #$GITHUB_RUN_NUMBER failed" \
  19. --label bug \
  20. --label area:build \
  21. --label priority:p1 \
  22. --body-file body.txt