Skip to content

Commit 7056c62

Browse files
authored
Open issue when release failed (#1488)
When release job fails, we may not realize the issue. Let's open issue to notify us the release job failed. I've tested this change and it opened an issue like this. - title contains the release(d) version - actor is assigned - description contains failed job url ![image](https://github.com/user-attachments/assets/d2f0464d-2d0f-413a-b0df-da7966289e7e)
1 parent dd2893c commit 7056c62

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/publish.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,20 @@ jobs:
5656
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
5757
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSWORD }}
5858

59+
- name: Create GitHub Issue on Failure
60+
if: failure()
61+
uses: actions/github-script@v7
62+
with:
63+
script: |
64+
const { owner, repo } = context.repo;
65+
const version = process.env.VERSION;
66+
const issueTitle = `Release job for ${version} failed`;
67+
const issueBody = `The release job failed. Please check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.`;
68+
const assignees = [context.actor];
69+
await github.rest.issues.create({
70+
owner,
71+
repo,
72+
title: issueTitle,
73+
body: issueBody,
74+
assignees
75+
});

0 commit comments

Comments
 (0)