Report failed job #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Report failed job | |
on: | |
workflow_dispatch: | |
inputs: | |
job: | |
type: string | |
description: "Job reference. If single job failed for workflow use job ref (for example 7383755647), or if there | |
are multiple failed include job name (for example 7383755647/Store Model Tests). If multiple jobs have failed | |
for the same issue you can include a comma-separated list." | |
required: true | |
issue: | |
type: number | |
description: "GitHub issue number to link to" | |
required: true | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: "report-failed-job" | |
cancel-in-progress: false | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
- id: build | |
run: | |
mvn clean install | |
- id: report | |
env: | |
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
mvn exec:java -Preport-failed-job -Djob="${{ inputs.job }}" -Dissue="${{ inputs.issue }}" | |
- id: commit | |
env: | |
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if ( ! git diff --exit-code &>/dev/null ); then | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git add --all | |
git commit -m "Updated failed-jobs-reporting.yml" | |
git push | |
fi | |
deploy: | |
uses: ./.github/workflows/pages.yml | |
needs: [update] |