Skip to content

Commit 4b35ff7

Browse files
committed
ci: log CROSS_REPO_ISSUE_TOKEN presence on every run
Without this the job returns early whenever a PR body carries no cross-repo reference — which is most PRs — so a repository that has the secret and one that does not produce byte-identical logs. Whether the credential is provisioned stays unanswerable until a cross-repo reference happens to show up, possibly days later. Presence only; the value is never read into the log.
1 parent 6b17e81 commit 4b35ff7

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/cross-repo-issue-closer.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ jobs:
6060
'gi',
6161
);
6262
63+
// Report credential state on EVERY run, before any early return.
64+
// Otherwise a repository with the secret and one without look
65+
// identical until a cross-repo reference happens to show up —
66+
// which can be days — and "is it configured?" stays unanswerable.
67+
// Presence only; the value is never read into the log.
68+
const token = process.env.CROSS_REPO_TOKEN;
69+
core.info(
70+
`CROSS_REPO_ISSUE_TOKEN: ${token ? 'configured' : 'ABSENT — cross-repo closes will be reported, not performed'}`,
71+
);
72+
6373
const targets = new Map();
6474
for (const [, owner, repo, number] of body.matchAll(pattern)) {
6575
const key = `${owner}/${repo}#${number}`;
@@ -75,8 +85,6 @@ jobs:
7585
}
7686
core.info(`Cross-repo targets: ${[...targets.keys()].join(', ')}`);
7787
78-
const token = process.env.CROSS_REPO_TOKEN;
79-
8088
if (!token) {
8189
// Degrade VISIBLY. Someone has to close these by hand, and this
8290
// comment is the only thing that will tell them so.

0 commit comments

Comments
 (0)