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
5 changes: 5 additions & 0 deletions .changeset/native-preview-githead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/tsgo": patch
---

Fix the automated TypeScript-Go update workflow to pin the submodule to the commit shipped by `@typescript/native-preview@latest`.
23 changes: 20 additions & 3 deletions .github/workflows/update-typescript-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,22 @@ jobs:
id: before
run: echo "sha=$(git -C typescript-go rev-parse HEAD)" >> "$GITHUB_OUTPUT"

- name: Resolve native preview metadata
id: native_preview
run: |
metadata="$(npm view @typescript/native-preview@latest version gitHead --json)"
version="$(node -e 'const m = JSON.parse(process.argv[1]); if (!m.version) process.exit(1); process.stdout.write(m.version)' "$metadata")"
git_head="$(node -e 'const m = JSON.parse(process.argv[1]); if (!/^[0-9a-f]{40}$/.test(m.gitHead || "")) process.exit(1); process.stdout.write(m.gitHead)' "$metadata")"

echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "git_head=${git_head}" >> "$GITHUB_OUTPUT"

- name: Update TypeScript-Go submodule
run: git submodule update --init --remote typescript-go
run: |
git -C typescript-go fetch --depth 1 origin "${{ steps.native_preview.outputs.git_head }}"
git -C typescript-go checkout --detach "${{ steps.native_preview.outputs.git_head }}"
git -C typescript-go submodule sync --recursive
git -C typescript-go submodule update --init --recursive --force

- name: Regenerate shims and generated files
run: pnpm setup-repo --ci
Expand Down Expand Up @@ -124,9 +138,11 @@ jobs:
"@effect/tsgo": patch
---

Update \
Update to \
[\`@typescript/native-preview@${{ steps.native_preview.outputs.version }}\`](https://www.npmjs.com/package/@typescript/native-preview/v/${{ steps.native_preview.outputs.version }}), \
which ships \
[\`typescript-go\`](https://github.com/microsoft/typescript-go/commit/${{ steps.after.outputs.sha }}) \
to commit \`${{ steps.after.outputs.sha }}\`.
commit \`${{ steps.after.outputs.sha }}\`.
EOF

- name: Create Pull Request
Expand All @@ -144,6 +160,7 @@ jobs:

## TypeScript-Go

- Native preview version: `@typescript/native-preview@${{ steps.native_preview.outputs.version }}`
- Previous commit: `${{ steps.before.outputs.sha }}`
- Updated commit: `${{ steps.after.outputs.sha }}`
- Compare: ${{ steps.changelog.outputs.compare_url }}
Expand Down
Loading