feat: add input for label modification #80
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | ||
on: | ||
push: | ||
# Use push on master event to run workflow instead of pull_request | ||
# closed (merged) event because github token doesn't have write permission | ||
# for pull_request from fork repository. | ||
branches: | ||
- master | ||
- test_branch* | ||
tags: | ||
- 'v*.*.*' | ||
pull_request: | ||
types: | ||
- labeled | ||
jobs: | ||
release: | ||
if: github.event.action != 'labeled' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# Bump version on merging Pull Requests with specific labels. (bump:major,bump:minor,bump:patch) | ||
- id: bumpr | ||
if: !startsWith(github.ref, 'refs/tags/') | ||
name: haya14busa/action-bumpr | ||
uses: ./ | ||
with: | ||
major_labels: 'wontfix' | ||
minor_labels: 'bug,enhancement' | ||
patch_labels: 'documentation' | ||
# Update corresponding major and minor tag. e.g. Update v1 and v1.2 when releasing v1.2.3 | ||
- uses: haya14busa/action-update-semver@v1 | ||
if: !steps.bumpr.outputs.skip | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
tag: ${{ steps.bumpr.outputs.next_version }} | ||
# Get tag name. | ||
- id: tag | ||
shell: bash | ||
run: | | ||
if echo "${ startsWith(github.ref, 'refs/tags/') }}"; then | ||
echo "value=${{ github.ref }}" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "value=${{ steps.bumpr.outputs.next_version }}" >> "$GITHUB_OUTPUT" | ||
fi | ||
# Create release. | ||
- uses: actions/create-release@v1 | ||
if: steps.tag.outputs.value != '' | ||
env: | ||
# This token is provided by Actions, you do not need to create your own token | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.tag.outputs.value }} | ||
release_name: Release ${{ steps.tag.outputs.value }} | ||
body: ${{ steps.bumpr.outputs.message }} | ||
draft: false | ||
prerelease: false | ||
release-check: | ||
if: github.event.action == 'labeled' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# Post bumpr status comment | ||
- name: haya14busa/action-bumpr | ||
uses: ./ |