Skip to content

Commit

Permalink
ci: make sure release part of CI is running only on main
Browse files Browse the repository at this point in the history
  • Loading branch information
FRSgit committed Jan 6, 2025
1 parent 964e96a commit a6f549c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ jobs:
file_pattern: 'README.md'

# release
- name: Setup git user
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Setup git user
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- name: remove git auth
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: remove git auth
run: git config --unset http.https://github.com/.extraheader
- name: Authenticate with Registry
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Authenticate with Registry
run: |
echo "registry=http://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
Expand Down

0 comments on commit a6f549c

Please sign in to comment.