diff --git a/.github/workflows/prlint.yml b/.github/workflows/prlint.yml index 993e880..43a06be 100644 --- a/.github/workflows/prlint.yml +++ b/.github/workflows/prlint.yml @@ -1,20 +1,26 @@ name: PR Lint +run-name: PR Lint - ${{ jobs.prlint-reloaded.outputs.verdict || 'Validating...' }} on: pull_request: types: ['opened', 'edited', 'reopened', 'synchronize'] jobs: prlint-reloaded: runs-on: ubuntu-latest + outputs: + verdict: ${{ steps.3.outputs.verdict || steps.2.outputs.verdict || steps.1.outputs.verdict || 'Unknown' }} steps: - uses: maor-rozenfeld/prlint-reloaded@v1 + id: '1' with: title-regex: ^[A-Z][a-z]+?\s error-message: Your title must start with a capital letter, and a real word, e.g. 'Add GO support' - uses: maor-rozenfeld/prlint-reloaded@v1 + id: '2' with: title-regex: ^\S+\s+\S+\s+\S+ error-message: Your title must have at least three words - uses: maor-rozenfeld/prlint-reloaded@v1 + id: '3' with: title-regex: ^(?!\S+ing\s)(?!\S+ed\s) error-message: Use imperative mood (i.e write "Fix", not "Fixed" or "Fixing") diff --git a/lint.sh b/lint.sh index 3b4ae7c..4853871 100755 --- a/lint.sh +++ b/lint.sh @@ -8,8 +8,10 @@ # Match regex title with the title if grep -qP -- "$TITLE_REGEX" <<< "$TITLE"; then echo "Title matches regex: $TITLE_REGEX" + echo "verdict=Passed" >> "$GITHUB_OUTPUT" else echo "Title does not match regex: $TITLE_REGEX" >&2 echo "::error title=PR Title is invalid::$ERROR_MESSAGE" + echo "verdict=$ERROR_MESSAGE" >> "$GITHUB_OUTPUT" exit 1 fi \ No newline at end of file