From d45f87c660334e90642f51d8899db145a443856d Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 7 Nov 2026 08:27:58 +0100 Subject: [PATCH] feat(release): support source-only verification and forced planning --- ...__test-action-release-prepare-and-plan.yml | 95 ++++--------------- .../__test-action-release-verify.yml | 18 +++- actions/release/plan/README.md | 22 +++-- actions/release/plan/action.yml | 13 ++- actions/release/plan/index.js | 22 +++-- actions/release/plan/index.test.js | 65 +++++++++++++ actions/release/prepare/index.test.js | 32 +++++++ actions/release/verify/README.md | 20 ++-- actions/release/verify/action.yml | 6 +- actions/release/verify/index.js | 6 +- actions/release/verify/index.test.js | 43 ++++++++- 11 files changed, 232 insertions(+), 110 deletions(-) diff --git a/.github/workflows/__test-action-release-prepare-and-plan.yml b/.github/workflows/__test-action-release-prepare-and-plan.yml index 41dffc98..12214ad2 100644 --- a/.github/workflows/__test-action-release-prepare-and-plan.yml +++ b/.github/workflows/__test-action-release-prepare-and-plan.yml @@ -28,7 +28,7 @@ jobs: name: Tests for "release/plan" action runs-on: ubuntu-latest permissions: - contents: write + contents: read pull-requests: read steps: - name: Arrange - Checkout @@ -63,10 +63,11 @@ jobs: uses: $/actions/release/plan with: working-directory: actions/release/get-configuration - release-config: | + release-config: &plan-configuration | tag-prefix: configured- - tag-template: configured-$RESOLVED_VERSION - name-template: Configured $RESOLVED_VERSION + tag-template: configured-$RESOLVED_VERSION-final + name-template: Configured $RESOLVED_VERSION / protocol 1.0.0 + version-template: $MAJOR.$MINOR - name: Assert - Configured release identity uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -77,82 +78,28 @@ jobs: with: script: | const assert = require('node:assert/strict'); - assert.match(process.env.RELEASE_TAG, /^configured-\d+\.\d+\.\d+$/); - assert.match(process.env.RELEASE_NAME, /^Configured \d+\.\d+\.\d+$/); + assert.match(process.env.RELEASE_TAG, /^configured-\d+\.\d+-final$/); + assert.match(process.env.RELEASE_NAME, /^Configured \d+\.\d+ \/ protocol 1\.0\.0$/); assert.ok(['true', 'false'].includes(process.env.HAS_CHANGES)); - - name: Arrange - Create colliding tag - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - env: - RELEASE_TAG: ${{ steps.drafter-plan.outputs.tag }} - TARGET_SHA: ${{ github.sha }} - with: - github-token: ${{ github.token }} - script: | - const releaseTag = (process.env.RELEASE_TAG || '').trim(); - const targetSha = (process.env.TARGET_SHA || '').trim(); - - if (!releaseTag) { - throw new Error('Expected planned release tag before creating a colliding tag'); - } - - if (!targetSha) { - throw new Error('Expected target sha before creating a colliding tag'); - } - - await github.rest.git.createRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: `refs/tags/${releaseTag}`, - sha: targetSha, - }); - - - name: Act - Plan drafter release with existing tag - id: existing-tag-plan - continue-on-error: true + - name: Act - Force a read-only release plan + id: forced-plan uses: $/actions/release/plan with: working-directory: actions/release/get-configuration - - - name: Assert - Existing remote tag blocks release plan + force: "true" + release-config: *plan-configuration + - name: Assert - Forced plan preserves the configured identity uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: - RELEASE_TAG: ${{ steps.drafter-plan.outputs.tag }} - STEP_OUTCOME: ${{ steps.existing-tag-plan.outcome }} + HAS_CHANGES: ${{ steps.forced-plan.outputs.has-changes }} + RELEASE_TAG: ${{ steps.forced-plan.outputs.tag }} + RELEASE_NAME: ${{ steps.forced-plan.outputs.name }} + EXPECTED_TAG: ${{ steps.configured-plan.outputs.tag }} + EXPECTED_NAME: ${{ steps.configured-plan.outputs.name }} with: script: | - const assert = require('node:assert'); - - const releaseTag = (process.env.RELEASE_TAG || '').trim(); - const stepOutcome = (process.env.STEP_OUTCOME || '').trim(); - - assert.ok(releaseTag, 'Expected colliding tag to be set'); - assert.equal(stepOutcome, 'failure', `Expected plan action to fail when tag already exists, got "${stepOutcome}"`); - - - name: Cleanup - Delete colliding tag - if: always() - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - env: - RELEASE_TAG: ${{ steps.drafter-plan.outputs.tag }} - with: - github-token: ${{ github.token }} - script: | - const releaseTag = (process.env.RELEASE_TAG || '').trim(); - - if (!releaseTag) { - return; - } - - try { - await github.rest.git.deleteRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: `tags/${releaseTag}`, - }); - } catch (error) { - if (error.status === 404) { - return; - } - - throw error; - } + const assert = require('node:assert/strict'); + assert.equal(process.env.HAS_CHANGES, 'true'); + assert.equal(process.env.RELEASE_TAG, process.env.EXPECTED_TAG); + assert.equal(process.env.RELEASE_NAME, process.env.EXPECTED_NAME); diff --git a/.github/workflows/__test-action-release-verify.yml b/.github/workflows/__test-action-release-verify.yml index adc4db4d..289773ee 100644 --- a/.github/workflows/__test-action-release-verify.yml +++ b/.github/workflows/__test-action-release-verify.yml @@ -43,17 +43,27 @@ jobs: assert.equal(JSON.parse(process.env.RELEASES)[0].published, false); } NODE - - name: Act - Require a missing prepared tag - if: github.event_name != 'pull_request' + - name: Act - Verify source-only release without artifacts + id: source + uses: $/actions/release/verify + with: + tags: '["verify-${{ github.run_id }}-${{ github.run_attempt }}"]' + - name: Assert - Source-only release is ready + env: + RELEASES: ${{ steps.source.outputs.releases }} + run: | + node <<'NODE' + const assert = require('node:assert/strict'); + assert.equal(JSON.parse(process.env.RELEASES)[0].published, false); + NODE + - name: Act - Require a missing source tag id: missing-tag continue-on-error: true uses: $/actions/release/verify with: - artifact-ids: '["${{ steps.artifact.outputs.artifact-id }}"]' tags: '["verify-${{ github.run_id }}-${{ github.run_attempt }}"]' require-tags: "true" - name: Assert - Missing tag fails verification - if: github.event_name != 'pull_request' env: OUTCOME: ${{ steps.missing-tag.outcome }} run: test "$OUTCOME" = failure diff --git a/actions/release/plan/README.md b/actions/release/plan/README.md index 2e8335e5..44da7aba 100644 --- a/actions/release/plan/README.md +++ b/actions/release/plan/README.md @@ -40,13 +40,20 @@ Detect release changes and plan a release identity without creating a Git tag or ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-publish/actions/release/plan@f06e0e72a76bfca57c34d08d03e5c1914275fd4c # 2.0.0 +- uses: hoverkraft-tech/ci-github-publish/actions/release/plan@ with: # Optional partial Release Drafter configuration as a YAML or JSON mapping. # Supplied top-level keys override repository settings, which inherit shared defaults unless they declare their own _extends chain. # Mappings and lists are replaced. Pass identical overrides to release/plan and release/create. The _extends key is reserved. release-config: "" + # Plan a release even without relevant changes, using the version, tag and name calculated by Release Drafter. + # Configured version rules and identity templates remain authoritative. Existing tag collisions still fail; tags are never created or moved. + # Callers decide when forcing is allowed, for example only on manual default-branch runs. + # + # Default: `false` + force: "false" + # Whether to plan the release as a prerelease # Default: `false` prerelease: "false" @@ -91,6 +98,9 @@ Detect release changes and plan a release identity without creating a Git tag or | **`release-config`** | Optional partial Release Drafter configuration as a YAML or JSON mapping. | **false** | - | | | Supplied top-level keys override repository settings, which inherit shared defaults unless they declare their own _extends chain. | | | | | Mappings and lists are replaced. Pass identical overrides to release/plan and release/create. The _extends key is reserved. | | | +| **`force`** | Plan a release even without relevant changes, using the version, tag and name calculated by Release Drafter. | **false** | `false` | +| | Configured version rules and identity templates remain authoritative. Existing tag collisions still fail; tags are never created or moved. | | | +| | Callers decide when forcing is allowed, for example only on manual default-branch runs. | | | | **`prerelease`** | Whether to plan the release as a prerelease | **false** | `false` | | **`working-directory`** | Working directory used to scope release automation in a monorepo. | **false** | - | | | If specified, the action looks for `.github/release-configs/{slug}.yml`, where `slug` is derived from the working directory basename. | | | @@ -117,11 +127,11 @@ Detect release changes and plan a release identity without creating a Git tag or ## Outputs -| **Output** | **Description** | -| ----------------- | ------------------------------------------------------------------------------------------------ | -| **`has-changes`** | Whether the release has relevant changes, or no previous matching release exists (true or false) | -| **`tag`** | The planned release tag, including when there are no relevant changes | -| **`name`** | The planned release name, including when there are no relevant changes | +| **Output** | **Description** | +| ----------------- | -------------------------------------------------------------------------------------------------------------- | +| **`has-changes`** | Whether there are relevant changes, no previous matching release, or an explicit force request (true or false) | +| **`tag`** | The planned release tag, including when there are no relevant changes | +| **`name`** | The planned release name, including when there are no relevant changes | diff --git a/actions/release/plan/action.yml b/actions/release/plan/action.yml index 6b7511ac..5dcffc69 100644 --- a/actions/release/plan/action.yml +++ b/actions/release/plan/action.yml @@ -12,6 +12,12 @@ inputs: Supplied top-level keys override repository settings, which inherit shared defaults unless they declare their own _extends chain. Mappings and lists are replaced. Pass identical overrides to release/plan and release/create. The _extends key is reserved. default: "" + force: + description: | + Plan a release even without relevant changes, using the version, tag and name calculated by Release Drafter. + Configured version rules and identity templates remain authoritative. Existing tag collisions still fail; tags are never created or moved. + Callers decide when forcing is allowed, for example only on manual default-branch runs. + default: "false" prerelease: description: "Whether to plan the release as a prerelease" required: false @@ -51,7 +57,7 @@ inputs: outputs: has-changes: - description: "Whether the release has relevant changes, or no previous matching release exists (true or false)" + description: "Whether there are relevant changes, no previous matching release, or an explicit force request (true or false)" value: ${{ steps.release-plan.outputs.has-changes }} tag: description: "The planned release tag, including when there are no relevant changes" @@ -110,21 +116,24 @@ runs: PLANNED_RELEASE_TAG: ${{ steps.prepare-release.outputs.tag_name }} PLANNED_RELEASE_BODY: ${{ steps.prepare-release.outputs.body }} CHANGE_DETECTION_MARKER: ${{ steps.prepare-change-detection.outputs.marker }} + FORCE: ${{ inputs.force }} with: github-token: ${{ inputs.github-token }} script: | const { resolvePlan } = require(`${process.env.ACTION_PATH}/index.js`); try { + if (!["true", "false"].includes(process.env.FORCE)) throw new Error("force must be true or false."); const plan = await resolvePlan({ body: process.env.PLANNED_RELEASE_BODY, marker: process.env.CHANGE_DETECTION_MARKER, + force: process.env.FORCE === "true", tag: process.env.PLANNED_RELEASE_TAG, name: process.env.PLANNED_RELEASE_NAME, github, repo: context.repo, }); core.info(plan.hasChanges - ? 'Release planned with relevant changes or no previous release.' + ? 'Release planned with changes, no previous release, or an explicit force request.' : 'Release planned without relevant changes.'); core.setOutput('has-changes', plan.hasChanges ? 'true' : 'false'); core.setOutput('tag', plan.tag); diff --git a/actions/release/plan/index.js b/actions/release/plan/index.js index e10b366c..9be70fc0 100644 --- a/actions/release/plan/index.js +++ b/actions/release/plan/index.js @@ -38,17 +38,25 @@ function prepareConfiguration({ configPath, workspace, runnerTemp }) { }; } -async function assertTagDoesNotExist(github, repo, tag) { +async function tagExists(github, repo, tag) { try { await github.rest.git.getRef({ ...repo, ref: `tags/${tag}` }); } catch (error) { - if (error.status === 404) return; + if (error.status === 404) return false; throw new Error(`Cannot check remote tag ${tag}: ${error.message}`); } - throw new Error(`Remote tag already exists: ${tag}`); + return true; } -async function resolvePlan({ body, marker, tag, name, github, repo }) { +async function resolvePlan({ + body, + marker, + tag, + name, + github, + repo, + force = false, +}) { const prefix = `${marker}:`; const lineEnd = body?.indexOf("\n") ?? -1; if (!marker || !body?.startsWith(prefix) || lineEnd < 0) { @@ -72,9 +80,11 @@ async function resolvePlan({ body, marker, tag, name, github, repo }) { if (!releaseTag) { throw new Error("Cannot determine release tag. Configure Release Drafter."); } - await assertTagDoesNotExist(github, repo, releaseTag); + if (await tagExists(github, repo, releaseTag)) { + throw new Error(`Remote tag already exists: ${releaseTag}`); + } return { - hasChanges, + hasChanges: hasChanges || force, tag: releaseTag, name: name?.trim() || releaseTag, }; diff --git a/actions/release/plan/index.test.js b/actions/release/plan/index.test.js index 40f0ee30..2f144bad 100644 --- a/actions/release/plan/index.test.js +++ b/actions/release/plan/index.test.js @@ -214,3 +214,68 @@ test("unchanged releases still validate tag availability", async () => { ); } }); + +test("force plans an unchanged release without lowering the planned version", async () => { + const { input } = fixture({ + body: `${marker}:v1.0.0\n${marker}:no-changes`, + force: true, + }); + assert.deepEqual(await resolvePlan(input), { + hasChanges: true, + tag: "v1.1.0", + name: "Version 1.1.0", + }); +}); +test("force preserves custom tag and name formats from Release Drafter", async () => { + for (const tag of [ + "release-42", + "v1.3", + "package-1.3-final", + "package-1.3.0-rc.2", + ]) { + const name = `Release ${tag} / protocol 1.0.0`; + const { input, calls } = fixture({ + body: `${marker}:v1.0.0\n${marker}:no-changes`, + tag, + name, + force: true, + }); + assert.deepEqual(await resolvePlan(input), { hasChanges: true, tag, name }); + assert.deepEqual(calls, [{ ...repo, ref: `tags/${tag}` }]); + } +}); + +test("force rejects collisions without inventing a different tag", async () => { + for (const changes of ["* A relevant change", `${marker}:no-changes`]) { + for (const tag of ["v1.0.0", "release-42", "v1.3", "package-1.3.0-rc.2"]) { + const { input, calls } = fixture({ + force: true, + tag, + body: `${marker}:v1.0.0\n${changes}`, + }); + input.github.rest.git.getRef = async (request) => { + calls.push(request); + if (request.ref === `tags/${tag}`) return { data: {} }; + throw Object.assign(new Error("Not Found"), { status: 404 }); + }; + await assert.rejects(resolvePlan(input), { + message: `Remote tag already exists: ${tag}`, + }); + assert.deepEqual(calls, [{ ...repo, ref: `tags/${tag}` }]); + } + } +}); + +test("forced planning does not bypass tag API failures", async () => { + const { input } = fixture({ + force: true, + body: `${marker}:v1.0.0\n${marker}:no-changes`, + }); + input.github.rest.git.getRef = async () => { + throw Object.assign(new Error("Forbidden"), { status: 403 }); + }; + await assert.rejects( + resolvePlan(input), + /Cannot check remote tag v1.1.0: Forbidden/, + ); +}); diff --git a/actions/release/prepare/index.test.js b/actions/release/prepare/index.test.js index cbfbb1e6..f000706a 100644 --- a/actions/release/prepare/index.test.js +++ b/actions/release/prepare/index.test.js @@ -92,6 +92,38 @@ test("action loads generated configuration with repository inheritance and emits assert.deepEqual(writes, []); }); +test("no-change planning delegates version rules and identity templates to Release Drafter", async (t) => { + for (const entry of [ + { increment: "minor", versionTemplate: "$MAJOR.$MINOR", expected: "1.3" }, + { + increment: "major", + versionTemplate: "$MAJOR.$MINOR.$PATCH", + expected: "2.0.0", + }, + ]) { + const { workspace, input, outputs, writes } = await fixture(t); + await fs.writeFile( + path.join(workspace, ".github", "release.yml"), + JSON.stringify({ + "tag-prefix": "", + "tag-template": "train-$RESOLVED_VERSION-final", + "name-template": "Release $RESOLVED_VERSION / protocol 1.2.0", + "version-template": entry.versionTemplate, + categories: [ + { type: "version-resolver", "semver-increment": entry.increment }, + ], + template: "$PREVIOUS_TAG\n$CHANGES", + "no-changes-template": "No changes detected", + }), + ); + await run(input); + assert.equal(outputs.tag_name, `train-${entry.expected}-final`); + assert.equal(outputs.name, `Release ${entry.expected} / protocol 1.2.0`); + assert.equal(outputs.body, "1.2.0\nNo changes detected"); + assert.deepEqual(writes, []); + } +}); + test("explicit drafting uses the planned tag and tested commit without publishing", async (t) => { const { input, outputs, writes } = await fixture(t); input.env.RELEASE_DRY_RUN = "false"; diff --git a/actions/release/verify/README.md b/actions/release/verify/README.md index 73751e92..ff5c11e0 100644 --- a/actions/release/verify/README.md +++ b/actions/release/verify/README.md @@ -13,7 +13,7 @@ ## Overview -Verify that release artifacts belong to this run and commit, reject conflicting tags, and identify already published releases without changing repository state. +Verify release tags and publication state without changing the repository. When artifacts are supplied, also verify their workflow run and source commit. @@ -21,11 +21,11 @@ Verify that release artifacts belong to this run and commit, reject conflicting ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-publish/actions/release/verify@f06e0e72a76bfca57c34d08d03e5c1914275fd4c # 2.0.0 +- uses: hoverkraft-tech/ci-github-publish/actions/release/verify@ with: - # JSON array of validated artifact IDs from this workflow run and source commit. Require successful producer jobs with needs; artifact metadata does not prove validation passed. - # This input is required. - artifact-ids: "" + # Optional JSON array of validated artifact IDs from this workflow run and source commit. Omit for source-only releases. Supplied artifacts must pass all identity checks. Require successful validation jobs with needs; this action does not prove validation passed. + # Default: `[]` + artifact-ids: "[]" # JSON array of release tags. Existing lightweight or annotated tags must resolve to this workflow's source commit. Package-specific version validation belongs to the caller. # This input is required. @@ -41,11 +41,11 @@ Verify that release artifacts belong to this run and commit, reject conflicting ## Inputs -| **Input** | **Description** | **Required** | **Default** | -| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------- | -| **`artifact-ids`** | JSON array of validated artifact IDs from this workflow run and source commit. Require successful producer jobs with needs; artifact metadata does not prove validation passed. | **true** | - | -| **`tags`** | JSON array of release tags. Existing lightweight or annotated tags must resolve to this workflow's source commit. Package-specific version validation belongs to the caller. | **true** | - | -| **`require-tags`** | Require every tag to exist already, for releases prepared before validation. Leave false when publication creates new source tags. | **false** | `false` | +| **Input** | **Description** | **Required** | **Default** | +| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------- | +| **`artifact-ids`** | Optional JSON array of validated artifact IDs from this workflow run and source commit. Omit for source-only releases. Supplied artifacts must pass all identity checks. Require successful validation jobs with needs; this action does not prove validation passed. | **false** | `[]` | +| **`tags`** | JSON array of release tags. Existing lightweight or annotated tags must resolve to this workflow's source commit. Package-specific version validation belongs to the caller. | **true** | - | +| **`require-tags`** | Require every tag to exist already, for releases prepared before validation. Leave false when publication creates new source tags. | **false** | `false` | diff --git a/actions/release/verify/action.yml b/actions/release/verify/action.yml index 2768605c..407bbfed 100644 --- a/actions/release/verify/action.yml +++ b/actions/release/verify/action.yml @@ -1,13 +1,13 @@ name: Verify release sources -description: Verify that release artifacts belong to this run and commit, reject conflicting tags, and identify already published releases without changing repository state. +description: Verify release tags and publication state without changing the repository. When artifacts are supplied, also verify their workflow run and source commit. author: hoverkraft branding: icon: shield color: blue inputs: artifact-ids: - description: JSON array of validated artifact IDs from this workflow run and source commit. Require successful producer jobs with needs; artifact metadata does not prove validation passed. - required: true + description: Optional JSON array of validated artifact IDs from this workflow run and source commit. Omit for source-only releases. Supplied artifacts must pass all identity checks. Require successful validation jobs with needs; this action does not prove validation passed. + default: "[]" tags: description: JSON array of release tags. Existing lightweight or annotated tags must resolve to this workflow's source commit. Package-specific version validation belongs to the caller. required: true diff --git a/actions/release/verify/index.js b/actions/release/verify/index.js index 0c9824aa..fecd069d 100644 --- a/actions/release/verify/index.js +++ b/actions/release/verify/index.js @@ -4,11 +4,11 @@ class ReleaseVerification { this.context = context; } - async verify({ artifactIds, tags, requireTags = false }) { + async verify({ artifactIds = [], tags, requireTags = false }) { for (const [name, values] of Object.entries({ artifactIds, tags })) { if ( !Array.isArray(values) || - !values.length || + (name === "tags" && !values.length) || values.length > 256 || values.some( (value) => @@ -17,7 +17,7 @@ class ReleaseVerification { new Set(values).size !== values.length ) { throw new Error( - `${name} must be a nonempty array of unique strings, with at most 256 entries.`, + `${name} must be an array of unique strings, with at most 256 entries; tags must not be empty.`, ); } } diff --git a/actions/release/verify/index.test.js b/actions/release/verify/index.test.js index 73405934..77120c99 100644 --- a/actions/release/verify/index.test.js +++ b/actions/release/verify/index.test.js @@ -69,12 +69,12 @@ test("rejects expired artifacts, another run or commit, and missing source metad await assert.rejects(arrange({ artifact }).verify(), /this run and commit/); } }); -test("rejects malformed, unsafe, duplicate and empty inputs before API calls", async () => { +test("rejects malformed artifacts and malformed or empty tags before API calls", async () => { const { github, verify } = arrange(); github.rest.actions.getArtifact = () => assert.fail("Invalid input must not call GitHub."); for (const artifactIds of [ - [], + null, {}, ["0"], ["-1"], @@ -187,3 +187,42 @@ test("fails closed on artifact, tag, release and pagination API errors", async ( await assert.rejects(verify(), /Forbidden/); } }); + +for (const artifactIds of [undefined, []]) { + test(`verifies source-only releases with ${artifactIds === undefined ? "omitted" : "empty"} artifacts`, async () => { + for (const published of [false, true]) { + const { github, verify } = arrange({ + tags: { "v1.2.3": commit }, + releases: published ? [{ tag_name: "v1.2.3", draft: false }] : [], + }); + github.rest.actions.getArtifact = () => + assert.fail("Source-only releases need no Actions API permissions."); + assert.deepEqual(await verify({ artifactIds }), [ + { tag: "v1.2.3", published }, + ]); + } + }); +} +test("source-only releases retain tag conflicts, missing-tag and API-error checks", async () => { + await assert.rejects( + arrange({ tags: { "v1.2.3": { type: "commit", sha: "other" } } }).verify({ + artifactIds: [], + }), + /source commit/, + ); + await assert.rejects( + arrange().verify({ artifactIds: [], requireTags: true }), + /does not exist/, + ); + await assert.rejects( + arrange({ releases: [{ tag_name: "v1.2.3", draft: false }] }).verify({ + artifactIds: [], + }), + /no matching Git tag/, + ); + const { github, verify } = arrange(); + github.rest.git.getRef = () => { + throw Object.assign(new Error("Forbidden"), { status: 403 }); + }; + await assert.rejects(verify({ artifactIds: [] }), /Forbidden/); +});