File tree Expand file tree Collapse file tree 3 files changed +62
-1
lines changed
Expand file tree Collapse file tree 3 files changed +62
-1
lines changed Original file line number Diff line number Diff line change 4747
4848 The image can be pulled with `$ docker pull ghcr.io/cloudogu/helm:${{ steps.compare_releases.outputs.helmRelease }}-1`
4949 draft : false
50- prerelease : false
50+ prerelease : false
51+
52+ notify_failure :
53+ uses : ./.github/workflows/notify_failure.yml
54+ secrets :
55+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56+ with :
57+ needs_job : check_for_new_helm_version
Original file line number Diff line number Diff line change 1+ name : Notify Failure
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ needs_job :
7+ required : true
8+ type : string
9+ secrets :
10+ GITHUB_TOKEN :
11+ required : true
12+
13+ jobs :
14+ notify_failure :
15+ runs-on : ubuntu-latest
16+ needs :
17+ - ${{ inputs.needs_job }}
18+ permissions :
19+ issues : write
20+ contents : read
21+ if : failure()
22+
23+ env :
24+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
25+
26+ steps :
27+ - name : Manage issue
28+ id : manage_issue
29+ run : |
30+ ISSUE_TITLE="[Workflow Log] Central error logging"
31+ ISSUE_DATA=$(gh issue list -R "$GITHUB_REPOSITORY" --search "is:open in:title \"${ISSUE_TITLE}\"" --json number --limit 1)
32+ ISSUE_NUMBER=$(echo "$ISSUE_DATA" | jq -r '.[0].number')
33+
34+ if [ -z "$ISSUE_NUMBER" ] || [ "$ISSUE_NUMBER" = "null" ]; then
35+ NEW_ISSUE_NUMBER=$(gh issue create -R "$GITHUB_REPOSITORY" --title "$ISSUE_TITLE" \
36+ --body "This issue serves as a central log for all workflow errors." \
37+ | sed -n 's/.*#\([0-9]\+\).*/\1/p')
38+ echo "issue_number=$NEW_ISSUE_NUMBER" >> "$GITHUB_OUTPUT"
39+ else
40+ echo "issue_number=$ISSUE_NUMBER" >> "$GITHUB_OUTPUT"
41+ fi
42+
43+ - name : Create comment
44+ run : |
45+ gh issue comment ${{ steps.manage_issue.outputs.issue_number }} \
46+ -R "$GITHUB_REPOSITORY" \
47+ --body "***Workflow failure*** ([View workflow run for details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}))"
Original file line number Diff line number Diff line change 5353 tags : ${{ env.TAGS }}
5454 - name : Check manifest
5555 run : docker buildx imagetools inspect ${{ env.GHCR_IMAGE }}:${{ env.VERSION }}
56+
57+ notify_failure :
58+ uses : ./.github/workflows/notify_failure.yml
59+ secrets :
60+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
61+ with :
62+ needs_job : push_to_registry
You can’t perform that action at this time.
0 commit comments