From b68ba5d8e200f5cfe0f275447fb938782c7fb1e6 Mon Sep 17 00:00:00 2001 From: YuitoAkatsuki Date: Mon, 8 Apr 2024 17:38:18 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20flow=E3=81=AE=E6=89=8B=E9=A0=86=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 72 ++++------------------------------- 1 file changed, 8 insertions(+), 64 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4c53ba3..4e9b5f8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,75 +31,19 @@ jobs: - name: Update Version if: ${{ env.NPM_VERSION != env.NPM_NEW_VERSION }} - run: npm version patch - - - name: Push - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: git push -u origin ${{ github.event.pull_request.head.ref }} - - Minor: - runs-on: ubuntu-latest - if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || contains(github.event.pull_request.labels[*].name, 'minor') }} - steps: - - name: Checkout Base Branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.base.ref }} - - - name: Version Get - run: | - NPM_VERSION=$(node -e "console.log(require('./package.json').version)") - printf "NPM_VERSION=%s" "$NPM_VERSION" >> $GITHUB_ENV - - - name: Checkout PR Branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.ref }} - - - name: Version Get run: | - NPM_NEW_VERSION=$(node -e "console.log(require('./package.json').version)") - printf "NPM_NEW_VERSION=%s" "$NPM_NEW_VERSION" >> $GITHUB_ENV + npm version patch + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" - - name: Update Version + - name: Commit changes if: ${{ env.NPM_VERSION != env.NPM_NEW_VERSION }} - run: npm version minor - - - name: Push - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: git push -u origin ${{ github.event.pull_request.head.ref }} - - Major: - runs-on: ubuntu-latest - if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || contains(github.event.pull_request.labels[*].name, 'major') }} - steps: - - name: Checkout Base Branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.base.ref }} - - - name: Version Get - run: | - NPM_VERSION=$(node -e "console.log(require('./package.json').version)") - printf "NPM_VERSION=%s" "$NPM_VERSION" >> $GITHUB_ENV - - - name: Checkout PR Branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.ref }} - - - name: Version Get run: | - NPM_NEW_VERSION=$(node -e "console.log(require('./package.json').version)") - printf "NPM_NEW_VERSION=%s" "$NPM_NEW_VERSION" >> $GITHUB_ENV + git commit -am "Bump version to $NPM_NEW_VERSION" - - name: Update Version + - name: Push changes if: ${{ env.NPM_VERSION != env.NPM_NEW_VERSION }} - run: npm version major - - - name: Push env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: git push -u origin ${{ github.event.pull_request.head.ref }} + run: | + git push -u origin ${{ github.event.pull_request.head.ref }}