Skip to content

Commit

Permalink
npm version을 활용하도록 수정 시도
Browse files Browse the repository at this point in the history
  • Loading branch information
young-do committed Aug 23, 2024
1 parent 8399588 commit 3383aa3
Showing 1 changed file with 29 additions and 13 deletions.
42 changes: 29 additions & 13 deletions .github/workflows/bump-up.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# @see: https://github.com/anothrNick/github-tag-action
name: Bump version
on:
push:
Expand All @@ -7,18 +6,35 @@ on:
- feature/auto-tagging

jobs:
build:
update-version:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Checkout code
uses: actions/checkout@v4

- name: Determine version type
id: get_version_type
run: |
last_commit_message=$(git log -1 --pretty=%B)
echo "Last commit message: $last_commit_message"
if [[ "$last_commit_message" == *"#major"* ]]; then
echo "version_type=major" >> $GITHUB_ENV
elif [[ "$last_commit_message" == *"#minor"* ]]; then
echo "version_type=minor" >> $GITHUB_ENV
else
echo "No specific version bump keyword found. Defaulting to patch."
echo "version_type=patch" >> $GITHUB_ENV
fi
- name: Bump version and push tag
uses: anothrNick/github-tag-action@v1 # Don't use @master or @v1 unless you're happy to test the latest version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token
WITH_V: true
DRY_RUN: true
- name: Bump version
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
npm version ${{ env.version_type }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
tags: true
branch: ${{ github.ref }}

0 comments on commit 3383aa3

Please sign in to comment.