Skip to content

Commit

Permalink
create an issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kilamaelie committed Feb 12, 2024
1 parent 144e9f5 commit d72d29d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ jobs:
docker push ${{ env.WEBSITE_IMAGE }}
docker push ${{ env.NGINX_IMAGE }}
- name: create an issue
if: ${{ failure() }}
run: |
echo $(cat error)
ERROR=$(cat error)
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/issues \
--header 'authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"title": "Automated issue for a commit: ${{ github.job }}",
"body": "## Description\n\nThis issue was automatically created by the GitHub Action.\n\nThe Job **`${{github.job}}`** of the workflow run **`${{github.run_number}}`** failed with the following error:\n\n`'"$ERROR"'`\n\n## Run details\n\n- Workflow: `${{ github.workflow }}`\n\n- The actor of the run: `${{ github.triggering_actor }}`\n\n- The commit hash was: _${{ github.sha }}_\n\nKindly fix it in the shortest time possible.\n\nThank you."
}' \
--fail
checking-secrets:
name: Checking secrets
runs-on: ubuntu-latest
Expand Down

0 comments on commit d72d29d

Please sign in to comment.