Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the "Pull Request Checks" workflow #72

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,16 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Check the PR title and description
run: |
errors=
- name: Check the PR title
uses: gsactions/commit-message-checker@v2
with:
pattern: '^.{1,72}$'
excludeTitle: 'false'
excludeDescription: 'true'
error: 'The maximum line length of 72 characters is exceeded.'

if grep -qE '^.{73,}$' <<< "${{ github.event.pull_request.title }}"; then
printf "ERROR: The PR title is longer than 72 characters:\n"
printf " > ${{ github.event.pull_request.title }}\n"
errors=true
fi

issue_regex='(Resolves|Fixes):? +(https:\/\/github.com\/)?AlmaLinux\/build-system(\/issues\/|#)[0-9]+'
if ! grep -qE "$issue_regex" <<< "${{ github.event.pull_request.body }}"; then
printf "ERROR: You need at least one \"Resolves|Fixes: <issue link>\" line.\n"
errors=true
fi

if [[ $errors == true ]]; then
exit 2
fi
- name: Check the PR description
uses: gsactions/commit-message-checker@v2
with:
pattern: '(Resolves|Fixes):? +(https:\/\/github.com\/)?AlmaLinux\/build-system(\/issues\/|#)[0-9]+'
error: 'You need at least one "Resolves|Fixes: <issue link>" line.'
Loading