| name: Issue On Error | |
| # This workflow can be called from other workflows in order to generate | |
| # an issue on failure. | |
| # | |
| # With only the required inputs issue will have the title of the failing workflow | |
| # and a link to it. | |
| # | |
| # If the optional pr_number and link are provided the title and link will be for | |
| # the PR. | |
| # | |
| # Either type of issue will be tagged (by default with ci:bot_issue). | |
| # If an issue already exists, a comment will be added with a timestamp of the | |
| # new failure and a link. | |
| on: | |
| workflow_call: | |
| inputs: | |
| repo: | |
| type: string | |
| required: true | |
| workflow: | |
| type: string | |
| required: true | |
| run_id: | |
| type: string | |
| required: true | |
| run_number: | |
| type: string | |
| required: true | |
| flag_label: | |
| type: string | |
| default: 'ci:bot_issue' | |
| pr_number: | |
| type: string | |
| pr_link: | |
| type: string | |
| secrets: | |
| token: | |
| required: true | |
| jobs: | |
| error-trap: | |
| runs-on: ubuntu-latest | |
| name: Error Trap | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Run Reporting Script | |
| env: | |
| REPO: ${{ inputs.repo }} | |
| WORKFLOW: ${{ inputs.workflow }} | |
| RUN_ID: ${{ inputs.run_id }} | |
| RUN_NUMBER: ${{ inputs.run_number }} | |
| GITHUB_TOKEN: ${{ secrets.token }} | |
| FLAG_LABEL: ${{ inputs.flag_label }} | |
| PR_NUMBER: ${{ inputs.pr_number }} | |
| PR_LINK: ${{ inputs.pr_link }} | |
| run: | | |
| python3 ci/issue_on_error.py | |