Skip to content

Commit fcd40c5

Browse files
committed
fix(qa): authenticate Mantis request provenance
1 parent cdadc04 commit fcd40c5

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎.github/workflows/mantis-telegram-desktop-proof.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ on:
2929
required: false
3030
type: string
3131
request_source:
32-
description: Internal request source for PR-triggered runs
32+
description: Dispatcher request source; ignored for manual runs
3333
required: false
3434
default: workflow_dispatch
3535
type: string
@@ -87,7 +87,12 @@ jobs:
8787
}
8888
8989
const body = inputs.instructions || "";
90-
const requestSource = inputs.request_source || "workflow_dispatch";
90+
const dispatcherSources = new Set(["clawsweeper_label", "issue_comment"]);
91+
const requestSource =
92+
context.actor === "github-actions[bot]" &&
93+
dispatcherSources.has(inputs.request_source)
94+
? inputs.request_source
95+
: "workflow_dispatch";
9196
const { owner, repo } = context.repo;
9297
const { data: pr } = await github.rest.pulls.get({
9398
owner,

‎test/scripts/mantis-telegram-desktop-proof-workflow.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,11 @@ describe("Mantis Telegram Desktop proof workflow", () => {
339339
expect(dispatchText).not.toContain("secrets.");
340340
expect(dispatch?.steps).toHaveLength(1);
341341
expect(workflowText).toContain('setOutput("request_source", requestSource)');
342+
expect(workflowText).toContain('context.actor === "github-actions[bot]"');
343+
expect(workflowText).toContain(
344+
'const dispatcherSources = new Set(["clawsweeper_label", "issue_comment"]);',
345+
);
346+
expect(workflowText).toContain("dispatcherSources.has(inputs.request_source)");
342347
expect(workflowText).toContain('requestSource === "clawsweeper_label"');
343348
expect(workflowText).toContain("pr.head.repo.full_name !== `${owner}/${repo}`");
344349
expect(workflowText).toContain("allow-bot-users: github-actions[bot]");

0 commit comments

Comments
 (0)