Skip to content

Commit

Permalink
feat: fix token
Browse files Browse the repository at this point in the history
  • Loading branch information
scott45 committed Dec 2, 2024
1 parent 17d0052 commit 7f10f14
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
build-and-publish:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_LIB }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
packages: write
contents: read
Expand All @@ -34,7 +34,7 @@ jobs:

- name: Set up NPM authentication
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN_LIB }}" > ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
cat .npmrc
- name: Configure Git
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Version bumping
env:
GITHUB_TOKEN: '${{ secrets.GH_TOKEN_LIB }}'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
commit_message=$(git log -1 --pretty=%B)
echo "Commit message: $commit_message"
Expand All @@ -67,8 +67,8 @@ jobs:
- name: Publish package
run: npm publish
env:
GITHUB_TOKEN: '${{ secrets.GH_TOKEN_LIB }}'
NODE_AUTH_TOKEN: '${{ secrets.GH_TOKEN_LIB }}'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
NODE_AUTH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: Capture Version
id: capture_version
Expand All @@ -79,16 +79,16 @@ jobs:
- name: Push Changes in package.json and make PRs
run: |
export GH_USERNAME=${{ secrets.GH_USERNAME }}
export GH_TOKEN=${{ secrets.GH_TOKEN_LIB }}
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
git config --global user.name ${{ secrets.GH_USERNAME }}
# Clear the GITHUB_TOKEN environment variable and use a temporary file for gh authentication
echo "${{ secrets.GH_TOKEN_LIB }}" > /tmp/gh_token
echo "${{ secrets.GITHUB_TOKEN }}" > /tmp/gh_token
unset GITHUB_TOKEN
unset GH_TOKEN
gh auth login --with-token < /tmp/gh_token
git clone https://${{ secrets.GH_USERNAME }}:${{ secrets.GH_TOKEN_LIB }}@github.com/${{ github.repository }}.git
git clone https://${{ secrets.GH_USERNAME }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
REPO_NAME=$(basename -s .git https://github.com/${{ github.repository }}.git)
cd $REPO_NAME
echo "Currently in repository directory: $(pwd)"
Expand Down

0 comments on commit 7f10f14

Please sign in to comment.