add issue on failing github actions #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See RM #55707
add issue on failing github actions mailhog-image#1
add issue on failing github actions helm-docker#6
How to test the github change action before merging:
Create an example repository e.g. xyz on github and create a github actions file like this. Either via the github editor or while creating a new file and put it under the .github/workflows/ directory:
/gihub_repo/.github/workflows/main_task.yml - First job - Failing simulation
/gihub_repo/.github/workflows/notify_failure.yml - Second job - Issue handling itself
On every commit or push, the GitHub Actions workflow runs:
The first job simulates a failure so that the comment and issue creation job is triggered. It is not part of the actual pull request itself; it only exists to demonstrate how to test the workflow.
The second job performs two important steps:
2.1 The first step checks whether a general issue for workflow runs already exists. If it does not, a new issue is created. The ID of this newly created issue is then passed to the next step.
2.2 In the second step, a comment is posted—using the GitHub CLI, the API, and a token—on the previously found or newly created issue, based on the failed workflow run.
This allows anyone interested to subscribe to the issue and stay informed about workflow failures.