Skip to content

Commit

Permalink
Fixes for PR checklist workflow (#2091)
Browse files Browse the repository at this point in the history
* Fixes for PR checklist workflow

* Add draft state PR triggers
  • Loading branch information
Alexsandruss authored Oct 8, 2024
1 parent 2f73b9d commit c16f4e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/pr-checklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ name: Check PR Checklist

on:
pull_request:
types: [opened, edited, synchronize]
types: [opened, edited, synchronize, ready_for_review, converted_to_draft]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name }}-${{ github.event.number || github.sha }}
Expand All @@ -44,6 +47,7 @@ jobs:
});
core.setOutput('body', pr_desc.data.body)
core.setOutput('draft', pr_desc.data.draft)
core.setOutput('author', pr_desc.data.user.login)
- name: Check if all checkboxes are checked
id: checkboxes
env:
Expand All @@ -52,7 +56,7 @@ jobs:
UNCHECKED=$(echo "$DESCRIPTION" | grep -c '\[ \]' || true)
echo "unchecked=$UNCHECKED" >> $GITHUB_OUTPUT
- name: Fail if not all checkboxes are checked and PR is not draft
if: ${{ (steps.pr.outputs.draft == 'false') && (steps.checkboxes.outputs.unchecked != '0') }}
if: ${{ (steps.pr.outputs.draft == 'false') && (steps.checkboxes.outputs.unchecked != '0') && (steps.pr.outputs.author != 'renovate') }}
run: |
echo "Unchecked checkboxes: ${{ steps.checkboxes.outputs.unchecked }}"
exit 1

0 comments on commit c16f4e6

Please sign in to comment.