Skip to content

Commit fb7c3cf

Browse files
committed
fixes
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent dbf0490 commit fb7c3cf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/build-pr-cmk.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ concurrency:
2828
permissions:
2929
contents: read
3030
pull-requests: write
31+
issues: write
3132

3233
jobs:
3334
build:
@@ -64,19 +65,21 @@ jobs:
6465
6566
- name: Comment or update cmk build artifact on PR
6667
uses: actions/github-script@v7
68+
if: github.event.pull_request.head.repo.full_name == github.repository
6769
with:
6870
script: |
6971
const issue_number = context.payload.pull_request.number;
7072
const identifier = "cmk-build-artifact-comment";
7173
const jobStatus = "${{ job.status }}";
7274
const artifactUrl = "${{ steps.upload_artifact.outputs.artifact-url }}";
73-
const expiryDate = "${{ steps.expiry_date.outputs.expiry_date }}";
7475
const runId = "${{ github.run_id }}";
7576
const repo = "${{ github.repository }}";
7677
7778
let commentBody = `<!-- ${identifier} -->\n`;
7879
7980
if (jobStatus === 'success') {
81+
const expiry = addDays(new Date(), 10);
82+
const expiryDate = expiry.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' });
8083
commentBody += `✅ Build complete for PR #${issue_number}.\n\n`;
8184
commentBody += `🔗 Download the [cmk binaries](${artifactUrl}) (expires on ${expiryDate})`;
8285
} else {

0 commit comments

Comments
 (0)