Skip to content

fix: fix Latest Dart Version action #14

fix: fix Latest Dart Version action

fix: fix Latest Dart Version action #14

Workflow file for this run

name: WIP Check
on:
pull_request:
# edited is to get notified about PR title changes
# ready_for_review to get notified when the PR changes from draft=true to
# draft=false
# The rest are the standard pull_request events to keep track to changes on
# commits and general PR status
types: [ edited, opened, ready_for_review, reopened, synchronize ]
jobs:
# In the future the PR could be converted to a Draft PR, but for now there
# is no API endpoint to update a PR to make it a draft.
wip-check:
runs-on: ubuntu-latest
if: '!github.event.pull_request.draft'
steps:
- name: Check if any commits start with WIP
run: |
title='${{github.event.pull_request.title}}'
r=0
if echo '$title' | grep -qiP '^WIP\b'
then
echo ::error "::The PR is a Work In Progress (WIP): $title"
r=$(($r+1))
fi
if wips=$(curl -s -H "Accept: application/vnd.github.v3+json" \
"${{github.event.pull_request.commits_url}}" \
| jq -r '.[].commit.message | capture("^(?<a>.*)").a' \
| grep -iP '^(WIP\b|(fixup|squash)!\s)') \
&& test -n "$wips"
then
while read wip
do
echo ::error "::Found WIP commit: $wip"
r=$(($r+1))
done <<< "$wips"
fi
exit $r