Skip to content

Commit e686131

Browse files
Record events if authentication is skipped
1 parent 2c3a298 commit e686131

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

dist/index.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ const EVENT_CONCLUDE_JOB = "conclude_job";
3232
const EVENT_FOD_ANNOTATE = "fod_annotate";
3333
const EVENT_NO_SYSTEMD_SHIM_FAILED = "no-systemd-shim-failed";
3434

35+
const EVENT_AUTH_SKIP_FORK = "auth-skip:fork";
36+
const EVENT_AUTH_SKIP_NOT_CONFIGURED = "auth-skip:not-configured";
37+
3538
// Feature flag names
3639
const FEAT_ANNOTATIONS = "hash-mismatch-annotations";
3740

@@ -725,12 +728,15 @@ class NixInstallerAction extends DetSysAction {
725728
const head = pr?.head?.repo?.full_name;
726729

727730
if (pr && base !== head) {
731+
this.recordEvent(EVENT_AUTH_SKIP_FORK);
728732
actionsCore.info(
729733
`Not logging in to FlakeHub: GitHub Actions does not allow OIDC authentication from forked repositories ("${head}" is not the same repository as "${base}").`,
730734
);
731735
return;
732736
}
733737

738+
this.recordEvent(EVENT_AUTH_SKIP_NOT_CONFIGURED);
739+
734740
actionsCore.info(
735741
`Not logging in to FlakeHub: GitHub Actions has not provided OIDC token endpoints; please make sure that \`id-token: write\` and \`contents: read\` are set for this step's (or job's) permissions.`,
736742
);

0 commit comments

Comments
 (0)