From 22621baeb9b3b0c00f3bc9a6d52f079dda751608 Mon Sep 17 00:00:00 2001 From: ChiHaoLu Date: Tue, 24 Sep 2024 15:02:55 +0800 Subject: [PATCH] revise pat --- .github/workflows/nextjs.yml | 9 ++++++++- .npmrc | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml index 0e5c02a..51e5edd 100644 --- a/.github/workflows/nextjs.yml +++ b/.github/workflows/nextjs.yml @@ -34,7 +34,6 @@ jobs: - name: Detect package manager id: detect-package-manager run: | - export PAT=${{ secrets.PAT }} if [ -f "${{ github.workspace }}/yarn.lock" ]; then echo "manager=yarn" >> $GITHUB_OUTPUT echo "command=install" >> $GITHUB_OUTPUT @@ -49,11 +48,19 @@ jobs: echo "Unable to determine package manager" exit 1 fi + - name: Replace values + shell: bash + env: + PAT: ${{ secrets.PAT }} + run: | + sed -i.back "s|{{PAT}}|${PAT}|g" /.npmrc - name: Setup Node uses: actions/setup-node@v4 with: node-version: "20" cache: ${{ steps.detect-package-manager.outputs.manager }} + # env: + # PAT: ${{ secrets.PAT }} - name: Setup Pages uses: actions/configure-pages@v5 with: diff --git a/.npmrc b/.npmrc index db936b0..dc6ca27 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,2 @@ @consenlabs:registry=https://npm.pkg.github.com/ -//npm.pkg.github.com/:_authToken=${PAT} \ No newline at end of file +//npm.pkg.github.com/:_authToken={{PAT}} \ No newline at end of file