@@ -60,13 +60,11 @@ jobs:
6060 }
6161 `);
6262
63- - name : Initialize Delete
64- id : init-delete
63+ - name : Initialize and Set Workflow URL
64+ id : init-workflow
6565 uses : actions/github-script@v7
6666 with :
6767 script : |
68- eval(process.env.GET_CONSOLE_LINK);
69-
7068 async function getWorkflowUrl(runId) {
7169 // Get the current job ID
7270 const jobs = await github.rest.actions.listJobsForWorkflowRun({
@@ -87,34 +85,16 @@ jobs:
8785 }
8886
8987 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 };
11290
11391 - name : Create Initial Delete Comment
11492 id : init-delete
11593 uses : actions/github-script@v7
11694 with :
11795 script : |
96+ eval(process.env.GET_CONSOLE_LINK);
97+
11898 let message = '🗑️ Starting app deletion';
11999 if ('${{ github.event_name }}' === 'pull_request') {
120100 const merged = '${{ github.event.pull_request.merged }}' === 'true';
@@ -125,7 +105,13 @@ jobs:
125105 issue_number: process.env.PR_NUMBER,
126106 owner: context.repo.owner,
127107 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')
129115 });
130116 return { commentId: comment.data.id };
131117
0 commit comments