Skip to content

Commit

Permalink
chore(workflows/release): Check PRなど
Browse files Browse the repository at this point in the history
  • Loading branch information
taiyme committed Aug 12, 2024
1 parent 94f93cf commit 60a75a3
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,27 @@ on:
- labeled

jobs:
check_actor:
name: Check release actor
check_pr:
name: Check PR
runs-on: ubuntu-latest
steps:
- if: github.actor != github.repository_owner
run: exit 1
- name: Check release actor
if: github.actor != github.repository_owner
run: |
echo "::error::Only repository owner can create releases."
exit 1
- name: Check release label
if: github.event.label.name != 'release'
run: |
echo "::error::You need to specify the 'release' label to create releases."
exit 1
get_new_version:
name: Get new version
runs-on: ubuntu-latest
needs:
- check_actor
- check_pr
outputs:
version: ${{ steps.new_version.outputs.NEW_VERSION }}
steps:
Expand All @@ -46,7 +55,7 @@ jobs:

- name: Update revision
if: github.env.PREV_BASE_VERSION == github.env.NEXT_BASE_VERSION
run: echo "REVISION=$(($(echo ${{ github.env.LATEST_TAG }} | cut -d '-'' -f 2 | cut -d '.' -f 2) + 1))" >> $GITHUB_ENV
run: echo "REVISION=$(($(echo ${{ github.env.LATEST_TAG }} | cut -d '-' -f 2 | cut -d '.' -f 2) + 1))" >> $GITHUB_ENV

- name: Build new version
id: new_version
Expand Down Expand Up @@ -136,20 +145,20 @@ jobs:
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git add .
git commit --author=. -m "${{ needs.get_new_version.outputs.version }}"
git commit --author=. -m "Release: ${{ needs.get_new_version.outputs.version }}"
git tag "${{ needs.get_new_version.outputs.version }}"
git push origin HEAD --follow-tags
merge_pr:
name: Merge Pull request
name: Merge PR
needs:
- commit_tag_push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: merge PR
- name: Merge PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down

0 comments on commit 60a75a3

Please sign in to comment.