Skip to content

Commit 7b94505

Browse files
authored
chore: use oidc to publish to vs code marketplace (#1167)
1 parent d76c337 commit 7b94505

3 files changed

Lines changed: 13 additions & 31 deletions

File tree

‎.github/workflows/release.yaml‎

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -68,32 +68,15 @@ jobs:
6868
path: ${{ steps.package.outputs.vsix }}
6969
if-no-files-found: error
7070

71-
# Job-level `if` can't read secrets, and the package job runs dependency
72-
# code, so a separate job reports which marketplace tokens are set.
73-
tokens:
74-
name: Check Marketplace Tokens
75-
runs-on: ubuntu-24.04
76-
timeout-minutes: 5
77-
outputs:
78-
vsce: ${{ steps.check.outputs.vsce }}
79-
ovsx: ${{ steps.check.outputs.ovsx }}
80-
steps:
81-
- name: Check which tokens are set
82-
id: check
83-
env:
84-
VSCE_PAT: ${{ secrets.VSCE_PAT }}
85-
OVSX_PAT: ${{ secrets.OVSX_PAT }}
86-
run: |
87-
echo "vsce=$([ -n "$VSCE_PAT" ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
88-
echo "ovsx=$([ -n "$OVSX_PAT" ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
89-
9071
publish-vscode:
9172
name: Publish to VS Marketplace
92-
needs: [package, tokens]
93-
if: needs.tokens.outputs.vsce == 'true'
73+
needs: package
74+
if: github.repository == 'coder/vscode-coder'
9475
runs-on: ubuntu-24.04
9576
timeout-minutes: 10
9677
environment: publish
78+
permissions:
79+
id-token: write # Allows generating an OIDC token.
9780
steps:
9881
- name: Setup Node.js
9982
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
@@ -118,14 +101,13 @@ jobs:
118101

119102
- name: Publish to VS Marketplace
120103
env:
121-
VSCE_PAT: ${{ secrets.VSCE_PAT }}
122104
VSIX: ${{ needs.package.outputs.vsix }}
123-
run: vsce publish $PRE_RELEASE_FLAG --packagePath "$VSIX"
105+
run: vsce publish $PRE_RELEASE_FLAG --packagePath "$VSIX" --oidc
124106

125107
publish-ovsx:
126108
name: Publish to Open VSX
127-
needs: [package, tokens]
128-
if: needs.tokens.outputs.ovsx == 'true'
109+
needs: package
110+
if: github.repository == 'coder/vscode-coder'
129111
runs-on: ubuntu-24.04
130112
timeout-minutes: 10
131113
environment: publish

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@
849849
"@vscode/codicons": "catalog:",
850850
"@vscode/test-cli": "^0.0.15",
851851
"@vscode/test-electron": "^3.1.0",
852-
"@vscode/vsce": "^4.0.0",
852+
"@vscode/vsce": "^4.1.0",
853853
"babel-plugin-react-compiler": "catalog:",
854854
"bufferutil": "^4.1.0",
855855
"coder": "link:vendor/coder",

‎pnpm-lock.yaml‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)