diff --git a/dist/index.js b/dist/index.js index 47e6202a..7895777b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -49,8 +49,7 @@ function run() { const runnerOS = process.env.RUNNER_OS || ""; const actor = process.env.GITHUB_ACTOR || ""; const branch = process.env.GITHUB_REF || ""; - const pr_title = process.env.PR_TITLE || undefined; - const pr_id = process.env.PR_ID || undefined; + const pr_link = process.env.PR_LINK || undefined; const commit_message = process.env.COMMIT_MESSAGE || undefined; const sha = process.env.COMMIT_SHA || ""; const customId = JSON.stringify({ @@ -65,11 +64,8 @@ function run() { { type: "mrkdwn", text: `*Env:* ${env}` }, ]; // Add PR details only if they exist: - if (pr_title) { - fields.push({ type: "mrkdwn", text: `*PR_TITLE:*\n${pr_title}` }); - } - if (pr_id) { - fields.push({ type: "mrkdwn", text: `*PR_ID:*\n${pr_id}` }); + if (pr_link) { + fields.push({ type: "mrkdwn", text: `*Pull Request:*\n${pr_link}` }); } if (commit_message) { fields.push({ diff --git a/package.json b/package.json index d519ba84..2f99da16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slack-approval", - "version": "1.1.5", + "version": "1.1.6", "description": "", "main": "index.js", "scripts": { diff --git a/src/index.ts b/src/index.ts index 3eaf3ff2..23831a01 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,8 +17,7 @@ async function run(): Promise { const runnerOS = process.env.RUNNER_OS || ""; const actor = process.env.GITHUB_ACTOR || ""; const branch = process.env.GITHUB_REF || ""; - const pr_title = process.env.PR_TITLE || undefined; - const pr_id = process.env.PR_ID || undefined; + const pr_link = process.env.PR_LINK || undefined; const commit_message = process.env.COMMIT_MESSAGE || undefined; const sha = process.env.COMMIT_SHA || ""; @@ -36,11 +35,8 @@ async function run(): Promise { ]; // Add PR details only if they exist: - if (pr_title) { - fields.push({ type: "mrkdwn", text: `*PR_TITLE:*\n${pr_title}` }); - } - if (pr_id) { - fields.push({ type: "mrkdwn", text: `*PR_ID:*\n${pr_id}` }); + if (pr_link) { + fields.push({ type: "mrkdwn", text: `*Pull Request:*\n${pr_link}` }); } if (commit_message) { fields.push({