Skip to content

Commit

Permalink
fix(): github action
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalaforge committed Feb 28, 2025
1 parent 63517a3 commit 450853b
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/label-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ on:
types: [ opened, edited ]

jobs:
check-title:
runs-on: ubuntu-latest
steps:
- name: Check PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "Checking PR Title: '$PR_TITLE'"
if [[ ! "$PR_TITLE" =~ ^Answer: ]]; then
echo "❌ PR title should start with 'Answer:[#challenge number]'"
echo "### ❌ PR title should start with 'Answer:[#challenge number]'" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo "✅ PR title format is correct."
echo "### ✅ PR title format is correct." >> $GITHUB_STEP_SUMMARY
fi
add_labels:
runs-on: ubuntu-latest
if: ${{ startsWith(github.event.pull_request.title, 'Answer') }}
Expand All @@ -19,11 +35,3 @@ jobs:
uses: ./.github/github-action/
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
wrong_labels:
runs-on: ubuntu-latest
if: ${{ !startsWith(github.event.pull_request.title, 'Answer') }}
steps:
- name: Set the value in bash
id: step_one
run: |
echo "::error PR title should start with Answer:[number of challenge]" >> $GITHUB_STEP_SUMMARY

0 comments on commit 450853b

Please sign in to comment.