Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ jobs:
# an immutable npm version, so the exact packed artifact must pass prepublish-smoke first.
needs: publish
permissions:
actions: read
contents: read
uses: ./.github/workflows/opencode-smoke.yml
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ jobs:
if: needs.process.outputs.prs_created == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_PR_NUMBER: ${{ fromJSON(needs.process.outputs.release_pr).number }}
RELEASE_PR_JSON: ${{ needs.process.outputs.release_pr }}
run: |
RELEASE_PR_NUMBER=$(jq -er '.number | select(type == "number")' \
<<<"$RELEASE_PR_JSON")
RELEASE_PR_SHA=$(gh api \
"repos/${GITHUB_REPOSITORY}/pulls/${RELEASE_PR_NUMBER}" \
--jq '.head.sha')
Expand Down
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
"publishConfig": {
"access": "public"
},
"files": [
"dist"
],
"files": ["dist"],
"dependencies": {
"@opencode-ai/plugin": "1.0.85"
},
Expand All @@ -51,8 +49,6 @@
"prepare": "husky"
},
"lint-staged": {
"*.{js,ts,json}": [
"biome check --write --no-errors-on-unmatched"
]
"*.{js,ts,json}": ["biome check --write --no-errors-on-unmatched"]
}
}
14 changes: 14 additions & 0 deletions src/release-workflows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,18 @@ describe('release workflows', () => {
expect(releaseWorkflow).toContain("outputs.prs_created == 'true'");
expect(readProjectFile('.mise/tasks/setup')).toContain('bun install --frozen-lockfile');
});

it('does not parse an absent release PR before the prerelease step condition is applied', () => {
expect(releaseWorkflow).not.toContain('fromJSON(needs.process.outputs.release_pr)');
expect(releaseWorkflow).toContain(
'RELEASE_PR_JSON: $' + '{{ needs.process.outputs.release_pr }}'
);
expect(releaseWorkflow).toContain('jq -er \'.number | select(type == "number")\'');
});

it('allows the post-publish smoke workflow to download the published artifact', () => {
expect(publishWorkflow).toMatch(
/postpublish-smoke:[\s\S]*?permissions:\n {6}actions: read\n {6}contents: read/
);
});
});
Loading