Bump Version (Patch) #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bump Version (Patch) | |
on: | |
workflow_dispatch: | |
env: | |
NODE_VERSION: 22 | |
NPM_REGISTRY: https://registry.npmjs.org/ | |
jobs: | |
bump-version: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Code Checkout | |
uses: actions/checkout@v4 | |
- name: SetUp Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{env.NODE_VERSION}} | |
registry-url: https://registry.npmjs.org/ | |
- name: Get GitHub User Info | |
id: user_info | |
run: | | |
# GitHub API를 사용하여 트리거한 사용자의 이메일과 이름 가져오기 | |
user_name="${{ github.actor }}" | |
user_email=$(curl -s https://api.github.com/users/${{ github.actor }} | jq -r '.email') | |
if [ -z "$user_email" ] || [ "$user_email" = "null" ]; then | |
user_email="${{ github.actor }}@users.noreply.github.com" | |
fi | |
echo "user_name=$user_name" >> $GITHUB_ENV | |
echo "user_email=$user_email" >> $GITHUB_ENV | |
- name: Bump Version (Patch) | |
run: | | |
git config --global user.email "${{ env.user_email }}" | |
git config --global user.name "${{ env.user_name }}" | |
npm version patch | |
git push origin main --tag |