diff --git a/README.md b/README.md index 1b1dbf5..7ab12ec 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Wait for Cloudflare Pages build to finish and send Slack notification ## Usage ```yml - name: Await CF Pages and send Slack notification - uses: arddluma/cloudflare-pages-slack-notification@v2.1 + uses: arddluma/cloudflare-pages-slack-notification@v2.3 with: accountEmail: ${{ secrets.CF_ACCOUNT_EMAIL }} apiKey: ${{ secrets.CF_API_KEY }} @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v2 - name: Await CF Pages and send Slack notification id: cf-pages - uses: arddluma/cloudflare-pages-slack-notification@v2.1 + uses: arddluma/cloudflare-pages-slack-notification@v2.3 with: accountEmail: ${{ secrets.CF_ACCOUNT_EMAIL }} apiKey: ${{ secrets.CF_API_KEY }} diff --git a/dist/action.js b/dist/action.js index b6b1361..39d22e4 100644 --- a/dist/action.js +++ b/dist/action.js @@ -11401,6 +11401,8 @@ async function run() { waiting = false; slack.send(`:x: CloudFlare Pages \`${latestStage.name}\` pipeline for project *${project}* \`FAILED\`! Environment: *${deployment.environment}* +Commit: ${import_utils.context.payload.head_commit.url} +Actor: *${import_utils.context.actor}* Deployment ID: *${deployment.id}* Checkout `).then(() => { console.log(`Slack message for ${latestStage.name} failed pipeline sent!`); @@ -11422,6 +11424,8 @@ Checkout `).then(() => { diff --git a/package.json b/package.json index ceec63e..fc51ebb 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,23 @@ { - "name": "cf-pages-await", - "version": "2.0.1", - "description": "Wait for a Cloudflare Pages build to finish and send Slack notification", - "main": "index.js", - "keywords": [], - "author": "arddluma", - "license": "MIT", - "scripts": { - "build": "esbuild src/action.ts --platform=node --target=es2019 --bundle --outfile=dist/action.js" - }, - "dependencies": { - "@actions/core": "^1.6.0", - "@actions/github": "^5.0.0", - "node-fetch": "^3.0.0", - "slack-notify": "^2.0.2" - }, - "devDependencies": { - "@types/node": "^16.11.6", - "esbuild": "^0.13.9", - "typescript": "^4.4.4" - } -} + "name": "cf-pages-await", + "version": "2.0.2", + "description": "Wait for a Cloudflare Pages build to finish and send Slack notification", + "main": "index.js", + "keywords": [], + "author": "arddluma", + "license": "MIT", + "scripts": { + "build": "esbuild src/action.ts --platform=node --target=es2019 --bundle --outfile=dist/action.js" + }, + "dependencies": { + "@actions/core": "^1.6.0", + "@actions/github": "^5.0.0", + "node-fetch": "^3.0.0", + "slack-notify": "^2.0.2" + }, + "devDependencies": { + "@types/node": "^16.11.6", + "esbuild": "^0.13.9", + "typescript": "^4.4.4" + } +} \ No newline at end of file diff --git a/src/action.ts b/src/action.ts index 6221553..b3d11c4 100644 --- a/src/action.ts +++ b/src/action.ts @@ -48,7 +48,7 @@ export default async function run() { if (latestStage.status === 'failure') { waiting = false; - slack.send(`:x: CloudFlare Pages \`${latestStage.name}\` pipeline for project *${project}* \`FAILED\`!\nEnvironment: *${deployment.environment}*\nDeployment ID: *${deployment.id}*\nCheckout `).then(() => { + slack.send(`:x: CloudFlare Pages \`${latestStage.name}\` pipeline for project *${project}* \`FAILED\`!\nEnvironment: *${deployment.environment}*\nCommit: ${context.payload.head_commit.url}\nActor: *${context.actor}*\nDeployment ID: *${deployment.id}*\nCheckout `).then(() => { console.log(`Slack message for ${latestStage.name} failed pipeline sent!`); }).catch((err) => { console.error(err); @@ -69,7 +69,7 @@ export default async function run() { core.setOutput('success', deployment.latest_stage.status === 'success' ? true : false); if (deployment.latest_stage.status === 'success' && true) { - slack.send(`:white_check_mark: CloudFlare Pages \`Deployment\` pipeline for project *${project}* \`SUCCEEDED\`!\nEnvironment: *${deployment.environment}*\nDeployment ID: *${deployment.id}*\nDeployment URL: ${deployment.url}\nCheckout `).then(() => { + slack.send(`:white_check_mark: CloudFlare Pages \`Deployment\` pipeline for project *${project}* \`SUCCEEDED\`!\nEnvironment: *${deployment.environment}*\nCommit: ${context.payload.head_commit.url}\nActor: *${context.actor}*\nDeployment ID: *${deployment.id}*\nDeployment URL: ${deployment.url}\nCheckout `).then(() => { console.log('Slack message for DEPLOYMENT succedded pipeline sent!'); }).catch((err) => { console.error(err);