-
Notifications
You must be signed in to change notification settings - Fork 6
64 lines (55 loc) · 1.73 KB
/
report-failed-job.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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]