Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
?
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaina authored Jan 16, 2024
1 parent 3e95b2d commit 8032b43
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ jobs:
- uses: actions/checkout@v4
# jqでpackage.jsonから現在のバージョンを取得
- name: Get current version
run: |
echo "current_version=$(jq -r '.version' package.json)" >> $GITHUB_ENV
echo "current_version=$(jq -r '.version' package.json)"
id: cv
run: "jq -r '.version' package.json"
id: get_current_version
# バージョンをインクリメント
- name: Increment version
uses: actions/script@v7
env:
CURRENT_VERSION: ${{ steps.get_current_version.outputs.stdout }}
with:
script: |
const now = new Date();
const year = now.toLocaleDateString('en-US', { year: 'numeric', timeZone: 'Asia/Tokyo' });
const month = now.toLocaleDateString('en-US', { month: 'numeric', timeZone: 'Asia/Tokyo' });
const [major, minor, patch] = '${{ steps.cv.outputs.current_version }}'.split('.');
console.log(year, month, '${{ steps.cv.outputs.current_version }}', major, minor, patch);
const [major, minor, patch] = process.env.CURRENT_VERSION.split('.');
console.log(year, month, process.env.CURRENT_VERSION, major, minor, patch);
if (year !== major || month !== minor) {
return `${year}.${month}.0`;
} else {
Expand Down

0 comments on commit 8032b43

Please sign in to comment.