-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.44 KB
/
version-major.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Bump Version (Major)
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 (Major)
run: |
git config --global user.email "${{ env.user_email }}"
git config --global user.name "${{ env.user_name }}"
npm version major
git push origin main --tag