File tree Expand file tree Collapse file tree 1 file changed +0
-47
lines changed
Expand file tree Collapse file tree 1 file changed +0
-47
lines changed Original file line number Diff line number Diff line change 2727 timeout_minutes : 60
2828 module_name : ' AWS ElastiCache'
2929 iam_oidc_role : ' arn:aws:iam::562563527952:role/oozou-internal-devops-github-action-oidc-role' # oozou internal account
30-
31- comment_on_failure :
32- name : Comment on PR if tests fail
33- runs-on : ubuntu-latest
34- needs : test
35- if : failure() && github.event_name == 'pull_request'
36- permissions :
37- pull-requests : write
38- steps :
39- - name : Report failed jobs
40- uses : actions/github-script@v7
41- with :
42- github-token : ${{ secrets.CICD_GH_PAT }}
43- script : |
44- const run_id = process.env.GITHUB_RUN_ID;
45- const { data: jobs } = await github.rest.actions.listJobsForWorkflowRun({
46- owner: context.repo.owner,
47- repo: context.repo.repo,
48- run_id: run_id
49- });
50-
51- const failedJobs = jobs.jobs
52- .filter(job => job.conclusion === 'failure')
53- .map(job => `- ${job.name} (Job ID: ${job.id})`)
54- .join('\n');
55-
56- if (!failedJobs) {
57- core.info("No failed jobs found.");
58- return;
59- }
60-
61- const prNumber = context.payload.pull_request?.number;
62- if (!prNumber) {
63- core.warning("Not a pull request context.");
64- return;
65- }
66-
67- const commentBody = `@claude ### ❌ Failed Jobs in Workflow Run #${run_id}\n${failedJobs}`;
68-
69- await github.rest.issues.createComment({
70- owner: context.repo.owner,
71- repo: context.repo.repo,
72- issue_number: prNumber,
73- body: commentBody
74- });
75-
76- core.info("Posted PR comment with failed jobs.");
You can’t perform that action at this time.
0 commit comments