Skip to content

Commit ff5b4ad

Browse files
committed
ci: use env guard for marketplace token
1 parent f9fc7fc commit ff5b4ad

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ permissions:
1111
jobs:
1212
release:
1313
runs-on: ubuntu-latest
14+
env:
15+
MARKETPLACE_PR_TOKEN: ${{ secrets.MARKETPLACE_PR_TOKEN }}
1416
steps:
1517
- uses: actions/checkout@v4
1618
- uses: pnpm/action-setup@v4
@@ -31,11 +33,11 @@ jobs:
3133
- id: marketplace-meta
3234
run: |
3335
node --input-type=module -e "import fs from 'fs'; const pkg = JSON.parse(fs.readFileSync('package.json','utf8')); const meta = JSON.parse(fs.readFileSync('napgram-plugin.json','utf8')); const id = (meta.id || pkg.name); console.log(`id=${id}`); console.log(`version=${pkg.version}`);" >> $GITHUB_OUTPUT
34-
- if: ${{ secrets.MARKETPLACE_PR_TOKEN != '' }}
36+
- if: ${{ env.MARKETPLACE_PR_TOKEN != '' }}
3537
name: Ensure marketplace fork
3638
uses: actions/github-script@v7
3739
with:
38-
github-token: ${{ secrets.MARKETPLACE_PR_TOKEN }}
40+
github-token: ${{ env.MARKETPLACE_PR_TOKEN }}
3941
script: |
4042
const upstream = { owner: 'NapGram', repo: 'marketplace' };
4143
const forkOwner = context.actor;
@@ -55,18 +57,18 @@ jobs:
5557
}
5658
}
5759
core.setFailed('marketplace fork not ready');
58-
- if: ${{ secrets.MARKETPLACE_PR_TOKEN != '' }}
60+
- if: ${{ env.MARKETPLACE_PR_TOKEN != '' }}
5961
uses: actions/checkout@v4
6062
with:
6163
repository: ${{ github.actor }}/marketplace
62-
token: ${{ secrets.MARKETPLACE_PR_TOKEN }}
64+
token: ${{ env.MARKETPLACE_PR_TOKEN }}
6365
path: marketplace
64-
- if: ${{ secrets.MARKETPLACE_PR_TOKEN != '' }}
66+
- if: ${{ env.MARKETPLACE_PR_TOKEN != '' }}
6567
run: node scripts/marketplace-upsert.mjs --index marketplace/index.json --snippet marketplace-index-snippet.json
66-
- if: ${{ secrets.MARKETPLACE_PR_TOKEN != '' }}
68+
- if: ${{ env.MARKETPLACE_PR_TOKEN != '' }}
6769
uses: peter-evans/create-pull-request@v6
6870
with:
69-
token: ${{ secrets.MARKETPLACE_PR_TOKEN }}
71+
token: ${{ env.MARKETPLACE_PR_TOKEN }}
7072
path: marketplace
7173
commit-message: "marketplace: update ${{ steps.marketplace-meta.outputs.id }} ${{ steps.marketplace-meta.outputs.version }}"
7274
branch: "marketplace/${{ steps.marketplace-meta.outputs.id }}-${{ steps.marketplace-meta.outputs.version }}"

0 commit comments

Comments
 (0)