Skip to content

Update release.yml

Update release.yml #44

# https://zenn.dev/kshida/articles/auto-generate-release-note-with-calver#pr-%E3%81%AB%E3%83%A9%E3%83%99%E3%83%AB%E3%82%92%E8%87%AA%E5%8B%95%E4%BB%98%E4%B8%8E%E3%81%A7%E3%81%8D%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E3%81%99%E3%82%8B
name: Automatically labeling pull request.
on:
pull_request:
types: [opened]
jobs:
auto-labeling-pr:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Get label name
id: label_name
run: |
branch_type=$(echo ${{github.head_ref}} | cut -d "/" -f1)
if [ $branch_type == 'feature' ]; then
label_name=$(echo "enhancement")
elif [ $branch_type == 'fix' ] || [ $branch_type == 'hotfix' ]; then
label_name=$(echo "bug")
else
label_name=$(echo "ignore-for-release")
fi
echo "::set-output name=label_name::$label_name"
- name: Auto labeling
if: ${{ steps.label_name.outputs.label_name }}
run: |
number=$(echo $GITHUB_REF | sed -e 's/[^0-9]//g')
gh pr edit $number --add-label ${{ steps.label_name.outputs.label_name }}