From 7b7d727278f2baf89c52cfe9ab5714b13bd0830c Mon Sep 17 00:00:00 2001 From: Yoav Tsook Date: Tue, 24 Dec 2024 17:48:37 +0200 Subject: [PATCH 1/3] new yml --- .github/workflows/node.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index cf407b3ed..449e719a0 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -48,7 +48,7 @@ jobs: SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} TEST_NAME: ${{ matrix.test-script }} - deploy: + deploy: runs-on: ubuntu-latest needs: [lint, tests] strategy: @@ -57,7 +57,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PAT_TOKEN }} fetch-depth: 0 - name: Install, build, configure git and lerna publish uses: actions/setup-node@v3 @@ -67,10 +67,12 @@ jobs: registry-url: 'https://registry.npmjs.org' - run: npm ci - run: npm run build --if-present - - run: | - git config --global user.email "octocat@github.com" - git config --global user.name "GitHub Actions" - git remote set-url origin "https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/wix/pro-gallery.git" + - name: Configure Git + run: | + git config --global user.email "your.actual@email.com" + git config --global user.name "GitHub Actions - Pro Gallery" + # Using a different format for the remote URL + git remote set-url origin "https://${{ secrets.PAT_TOKEN }}@github.com/wix/pro-gallery.git" - run: | echo "registry=http://registry.npmjs.org/" >> .npmrc echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc @@ -80,17 +82,27 @@ jobs: if: github.event_name == 'push' run: | git checkout ${{ github.ref_name }} - lerna publish patch --exact --yes --dist-tag stable --registry https://registry.npmjs.org --allow-branch ${{ github.ref_name }} + # Add these diagnostic commands + echo "Current branch: $(git branch --show-current)" + echo "Git status: $(git status)" + # Configure npm and lerna to use the PAT token for GitHub operations + npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} + npm config set @wix:registry=https://registry.npmjs.org/ + # Run lerna with explicit authentication + npx lerna publish patch --exact --yes --dist-tag stable --registry https://registry.npmjs.org/ --allow-branch ${{ github.ref_name }} --force-publish npm run changelog env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GH_TOKEN: ${{ secrets.PAT_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Push to pull request if: github.event_name == 'pull_request' && github.actor != 'dependabot' - run: lerna publish --canary --preid ${{ github.sha }} --yes --registry https://registry.npmjs.org --allow-branch ${{ github.ref_name }} + run: | + npx lerna publish --canary --preid ${{ github.sha }} --yes --registry https://registry.npmjs.org/ --allow-branch ${{ github.ref_name }} --force-publish env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GH_TOKEN: ${{ secrets.PAT_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} update-playground: runs-on: ubuntu-latest From 49db199df28f456ffd6d1cb5682c04b4f1d75651 Mon Sep 17 00:00:00 2001 From: Yoav Tsook Date: Tue, 24 Dec 2024 17:52:16 +0200 Subject: [PATCH 2/3] fix --- .github/workflows/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 449e719a0..c988b4ee8 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -72,7 +72,7 @@ jobs: git config --global user.email "your.actual@email.com" git config --global user.name "GitHub Actions - Pro Gallery" # Using a different format for the remote URL - git remote set-url origin "https://${{ secrets.PAT_TOKEN }}@github.com/wix/pro-gallery.git" + git remote set-url origin "https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/wix/pro-gallery.git" - run: | echo "registry=http://registry.npmjs.org/" >> .npmrc echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc From e11881056be30e02b476355d792561ad85b583af Mon Sep 17 00:00:00 2001 From: Yoav Tsook Date: Tue, 24 Dec 2024 17:53:33 +0200 Subject: [PATCH 3/3] fix --- .github/workflows/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index c988b4ee8..181b496ce 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -48,7 +48,7 @@ jobs: SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} TEST_NAME: ${{ matrix.test-script }} - deploy: + deploy: runs-on: ubuntu-latest needs: [lint, tests] strategy: