Skip to content

Commit 09b46c1

Browse files
authored
fix(ci): use env context for publish guards in release workflow (#75)
The `secrets` context is not available during workflow parsing for `workflow_dispatch` events, causing 'Unrecognized named-value: secrets' errors. Move VSCE_PAT and OVSX_PAT to job-level env and use `env.VSCE_PAT != ''` in step conditions instead. The `env` context is resolved at parse time and works with all trigger types. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent 2138a11 commit 09b46c1

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
timeout-minutes: 15
4242
permissions:
4343
contents: write
44+
env:
45+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
46+
OVSX_PAT: ${{ secrets.OVSX_PAT }}
4447
steps:
4548
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
4649
with:
@@ -60,12 +63,8 @@ jobs:
6063
# one-time browser setup (aex.dev.azure.com, PAT scopes, Open VSX agreement
6164
# + create-namespace + ownership claim), secret names, and troubleshooting.
6265
- name: Publish to VS Code Marketplace
63-
if: ${{ secrets.VSCE_PAT != '' }}
66+
if: env.VSCE_PAT != ''
6467
run: npx @vscode/vsce publish --packagePath patchloom.vsix
65-
env:
66-
VSCE_PAT: ${{ secrets.VSCE_PAT }}
6768
- name: Publish to Open VSX
68-
if: ${{ secrets.OVSX_PAT != '' }}
69+
if: env.OVSX_PAT != ''
6970
run: npx ovsx publish patchloom.vsix
70-
env:
71-
OVSX_PAT: ${{ secrets.OVSX_PAT }}

0 commit comments

Comments
 (0)