Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/automaticRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,15 @@ jobs:

The image can be pulled with `$ docker pull ghcr.io/cloudogu/helm:${{ steps.compare_releases.outputs.helmRelease }}-1`
draft: false
prerelease: false
prerelease: false

notify_failure:
permissions:
issues: write
contents: read

uses: ./.github/workflows/notify_failure.yml
needs: [ check_for_new_helm_version ]
if: failure()
with:
needs_job: check_for_new_helm_version
47 changes: 47 additions & 0 deletions .github/workflows/notify_failure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Notify Failure

on:
workflow_call:
inputs:
needs_job:
required: true
type: string
secrets:
GITHUB_TOKEN:
required: true

jobs:
notify_failure:
runs-on: ubuntu-latest
needs:
- ${{ inputs.needs_job }}
permissions:
issues: write
contents: read
if: failure()

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Manage issue
id: manage_issue
run: |
ISSUE_TITLE="[Workflow Log] Central error logging"
ISSUE_DATA=$(gh issue list -R "$GITHUB_REPOSITORY" --search "is:open in:title \"${ISSUE_TITLE}\"" --json number --limit 1)
ISSUE_NUMBER=$(echo "$ISSUE_DATA" | jq -r '.[0].number')

if [ -z "$ISSUE_NUMBER" ] || [ "$ISSUE_NUMBER" = "null" ]; then
NEW_ISSUE_NUMBER=$(gh issue create -R "$GITHUB_REPOSITORY" --title "$ISSUE_TITLE" \
--body "This issue serves as a central log for all workflow errors." \
| sed -n 's/.*#\([0-9]\+\).*/\1/p')
echo "issue_number=$NEW_ISSUE_NUMBER" >> "$GITHUB_OUTPUT"
else
echo "issue_number=$ISSUE_NUMBER" >> "$GITHUB_OUTPUT"
fi

- name: Create comment
run: |
gh issue comment ${{ steps.manage_issue.outputs.issue_number }} \
-R "$GITHUB_REPOSITORY" \
--body "***Workflow failure*** ([View workflow run for details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}))"
11 changes: 11 additions & 0 deletions .github/workflows/publishImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,14 @@ jobs:
tags: ${{ env.TAGS }}
- name: Check manifest
run: docker buildx imagetools inspect ${{ env.GHCR_IMAGE }}:${{ env.VERSION }}

notify_failure:
permissions:
issues: write
contents: read

uses: ./.github/workflows/notify_failure.yml
needs: [ push_to_registry ]
if: failure()
with:
needs_job: push_to_registry