ci: using inputs.git_username

This commit is contained in:
Leandro Costa 2025-06-27 13:01:42 -03:00
parent 647ff5d810
commit 31a8d5c5b5

View file

@ -60,7 +60,7 @@ runs:
shell: sh
run: |
cd dist
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${{ inputs.npm_token }}" > ~/.npmrc
if npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" > /dev/null 2>&1; then
echo "Package ${PACKAGE_NAME}@${PACKAGE_VERSION} already exists. Skipping publish."
@ -70,14 +70,13 @@ runs:
fi
cd ..
env:
NPM_TOKEN: ${{ secrets.npm_token }}
- name: Publish to Git Packages
shell: sh
run: |
npm config set registry https://git.lhprovedor.com.br/api/packages/$GIT_USERNAME/npm/
npm config set -- '//git.lhprovedor.com.br/api/packages/$GIT_USERNAME/npm/:_authToken' "${GIT_TOKEN}"
echo "Git Username: ${{ inputs.git_username }}"
npm config set registry https://git.lhprovedor.com.br/api/packages/${{ inputs.git_username }}/npm/
npm config set -- '//git.lhprovedor.com.br/api/packages/${{ inputs.git_username }}/npm/:_authToken' "${{ inputs.git_token }}"
cd dist
if npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" > /dev/null 2>&1; then
@ -88,6 +87,3 @@ runs:
fi
cd ..
env:
GIT_TOKEN: ${{ inputs.git_token }}
GIT_USERNAME: ${{ inputs.git_username }}