@@ -60,13 +60,11 @@ jobs:
60
60
}
61
61
`);
62
62
63
- - name : Initialize Delete
64
- id : init-delete
63
+ - name : Initialize and Set Workflow URL
64
+ id : init-workflow
65
65
uses : actions/github-script@v7
66
66
with :
67
67
script : |
68
- eval(process.env.GET_CONSOLE_LINK);
69
-
70
68
async function getWorkflowUrl(runId) {
71
69
// Get the current job ID
72
70
const jobs = await github.rest.actions.listJobsForWorkflowRun({
@@ -87,34 +85,16 @@ jobs:
87
85
}
88
86
89
87
const workflowUrl = await getWorkflowUrl(context.runId);
90
-
91
- const comment = await github.rest.issues.createComment({
92
- issue_number: process.env.PR_NUMBER,
93
- owner: context.repo.owner,
94
- repo: context.repo.repo,
95
- body: [
96
- ' Starting app deletion...',
97
- '',
98
- ' [View Delete Logs](' + workflowUrl + ')',
99
- '',
100
- getConsoleLink(process.env.PR_NUMBER)
101
- ].join('\n')
102
- });
103
-
104
- return {
105
- commentId: comment.data.id,
106
- workflowUrl
107
- };
108
-
109
- - name : Set workflow URL
110
- run : |
111
- echo "WORKFLOW_URL=${{ fromJSON(steps.init-delete.outputs.result).workflowUrl }}" >> $GITHUB_ENV
88
+ core.exportVariable('WORKFLOW_URL', workflowUrl);
89
+ return { workflowUrl };
112
90
113
91
- name : Create Initial Delete Comment
114
92
id : init-delete
115
93
uses : actions/github-script@v7
116
94
with :
117
95
script : |
96
+ eval(process.env.GET_CONSOLE_LINK);
97
+
118
98
let message = '🗑️ Starting app deletion';
119
99
if ('${{ github.event_name }}' === 'pull_request') {
120
100
const merged = '${{ github.event.pull_request.merged }}' === 'true';
@@ -125,7 +105,13 @@ jobs:
125
105
issue_number: process.env.PR_NUMBER,
126
106
owner: context.repo.owner,
127
107
repo: context.repo.repo,
128
- body: message
108
+ body: [
109
+ message,
110
+ '',
111
+ ' [View Delete Logs](' + process.env.WORKFLOW_URL + ')',
112
+ '',
113
+ getConsoleLink(process.env.PR_NUMBER)
114
+ ].join('\n')
129
115
});
130
116
return { commentId: comment.data.id };
131
117
0 commit comments