From 07f2aa5862a2dd94437faab48c30b9795f682d78 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 10 Dec 2024 11:29:03 -0700 Subject: [PATCH] add pr tasks check --- .github/pull_request_template.md | 5 ++++ .github/workflows/pr_tasks_check.yml | 36 ++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/pr_tasks_check.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..4067818f9f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,5 @@ +- [ ] Breaking changes enumerated in [the release issue](https://github.com/demergent-labs/azle/issues/2053) +- [ ] New documentation enumerated in [the release issue](https://github.com/demergent-labs/azle/issues/2053) +- [ ] Code has been declaratized +- [ ] Error handling beautiful (no unwraps or expects etc) +- [ ] Code tested thoroughly diff --git a/.github/workflows/pr_tasks_check.yml b/.github/workflows/pr_tasks_check.yml new file mode 100644 index 0000000000..87a2ed63fe --- /dev/null +++ b/.github/workflows/pr_tasks_check.yml @@ -0,0 +1,36 @@ +name: PR Tasks Check + +on: + pull_request: + types: + - opened + - synchronize + - ready_for_review + - reopened + - edited + +jobs: + docs_review_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: All tasks completed + run: | + # Get PR data including body and labels + PR_DATA=$(gh pr view ${{ github.event.pull_request.number }} --json body) + + # Extract PR body + PR_BODY=$(echo "$PR_DATA" | jq -r .body) + + # Check for unchecked tasks (- [ ]) + if echo "$PR_BODY" | grep -q "\- \[ \]"; then + echo "Error: Found unchecked tasks in the PR description. Please complete all tasks before merging." + echo "Unchecked tasks:" + echo "$PR_BODY" | grep "\- \[ \]" + exit 1 + fi + + echo "All tasks completed" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}