mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-22 12:43:16 +00:00
chore: Fix check for if breaking change label should be added ♻️ (#483)
This commit is contained in:
parent
384e616231
commit
983ea7f7a5
1 changed files with 10 additions and 8 deletions
18
.github/workflows/check-pr-title.yml
vendored
18
.github/workflows/check-pr-title.yml
vendored
|
@ -10,7 +10,7 @@ on:
|
||||||
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
pull-requests: read
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-title:
|
check-title:
|
||||||
|
@ -28,7 +28,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
header: pr-title-lint-error
|
header: pr-title-lint-error
|
||||||
message: |
|
message: |
|
||||||
Hey there and thank you for opening this pull request! 👋🏼
|
Thank you for opening this pull request!
|
||||||
|
|
||||||
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
|
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
|
||||||
|
|
||||||
|
@ -47,20 +47,22 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check breaking change label
|
- name: Check breaking change label
|
||||||
|
id: check_breaking_change
|
||||||
run: |
|
run: |
|
||||||
title="${{ github.event.pull_request.title }}"
|
title="${{ github.event.pull_request.title }}"
|
||||||
if ! echo "$title" | grep -qE '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!: '; then
|
pattern='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!:'
|
||||||
echo "::set-output name=breaking_change::true"
|
if echo "$title" | grep -qE "$pattern"; then
|
||||||
|
echo "breaking_change=true" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "::set-output name=breaking_change::false"
|
echo "breaking_change=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Add label
|
- name: Add label
|
||||||
if: steps.check.outputs.breaking_change == 'true'
|
if: steps.check_breaking_change.outputs.breaking_change == 'true'
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
github.issues.addLabels({
|
github.rest.issues.addLabels({
|
||||||
issue_number: context.issue.number,
|
issue_number: context.issue.number,
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
|
|
Loading…
Reference in a new issue