Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/operations/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ credentials documented below:

The finalize job uses them to commit and push aligned package versions to `main` as the Release App.
GitHub Release publication uses the repository-scoped workflow token so it has a rate-limit quota
independent from the shared Release App installation.
independent from the shared Release App installation. Tags created with this token do not start a
second workflow run, which keeps a manually dispatched stable release from publishing twice. Keep
release publication on the workflow token unless the tag trigger strategy changes with it.

## T3 Connect relay deployment

Expand Down
32 changes: 32 additions & 0 deletions scripts/release-workflow.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// @effect-diagnostics nodeBuiltinImport:off - reads the workflow file under test.
import * as NodeFS from "node:fs";
import * as NodePath from "node:path";
import * as NodeURL from "node:url";
import { assert, it } from "@effect/vitest";
import { parse as parseYaml } from "yaml";

const repoRoot = NodePath.resolve(NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)), "..");

type WorkflowStep = {
readonly uses?: string;
readonly with?: Readonly<Record<string, unknown>>;
};

type Workflow = {
readonly jobs?: Readonly<Record<string, { readonly steps?: ReadonlyArray<WorkflowStep> }>>;
};

it("publishes releases with GITHUB_TOKEN so generated tags do not retrigger the workflow", () => {
const workflow = parseYaml(
NodeFS.readFileSync(NodePath.join(repoRoot, ".github/workflows/release.yml"), "utf8"),
) as Workflow;
const releaseSteps = workflow.jobs?.release?.steps ?? [];
const publishSteps = releaseSteps.filter((step) =>
step.uses?.startsWith("softprops/action-gh-release@"),
);

assert.lengthOf(publishSteps, 2);
for (const step of publishSteps) {
assert.equal(step.with?.token, "${{ github.token }}");
}
});
Loading