Skip to content

Commit 658524b

Browse files
committed
Use pull request number for automation
1 parent 218a3da commit 658524b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/artifacts.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
workflows: ["CI"]
55
types:
66
- completed
7+
branches-ignore:
8+
- main
79

810
permissions:
911
pull-requests: write
@@ -26,13 +28,14 @@ jobs:
2628
throw new Error('Expected one artifact')
2729
}
2830
31+
const pullNumber = context.payload.workflow_run.pull_requests[0].number;
2932
const artifactUrl = artifacts.data.artifacts[0].archive_download_url;
3033
const commentBody = `<!-- build-artifact-comment -->\n📦 Docs artifacts are ready: ${artifactUrl}`;
3134
3235
const comments = await github.rest.issues.listComments({
3336
owner: context.repo.owner,
3437
repo: context.repo.repo,
35-
issue_number: context.issue.number,
38+
issue_number: pullNumber
3639
});
3740
3841
const botComment = comments.data.find(comment =>
@@ -51,7 +54,7 @@ jobs:
5154
await github.rest.issues.createComment({
5255
owner: context.repo.owner,
5356
repo: context.repo.repo,
54-
issue_number: context.issue.number,
57+
issue_number: pullNumber,
5558
body: commentBody
5659
});
5760
}

0 commit comments

Comments
 (0)