From 857c7ed1c80ceec61739b75099b325860cd4d8ca Mon Sep 17 00:00:00 2001
From: Mathias Kraus <elboberido@m-hias.de>
Date: Wed, 4 Dec 2024 13:48:34 +0100
Subject: [PATCH 1/2] [#3] Trigger CI when a PR changes from draft to ready

---
 .github/PULL_REQUEST_TEMPLATE.md |  4 ++--
 .github/workflows/build-test.yml | 14 ++------------
 .github/workflows/miri-check.yml |  4 +++-
 3 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 7dcad29c5..b47169837 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -7,8 +7,8 @@
 
 * Set the PR to a draft status, e.g. by the `Convert to draft` link, to indicate
 that the work is not yet ready for review
-* Once the PR is ready for review, press the `Ready for Review` button and push
-a final commit to trigger the CI
+* Once the PR is ready for review, press the `Ready for Review` button to
+trigger the CI
 
 ## Pre-Review Checklist for the PR Author
 
diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml
index bb9f11564..c494a3a2c 100644
--- a/.github/workflows/build-test.yml
+++ b/.github/workflows/build-test.yml
@@ -5,25 +5,15 @@ on:
     branches: [ main ]
   pull_request:
     branches: [ main, release* ]
+    types: [ opened, ready_for_review, reopened, synchronize ]
 
 # env:
   # RUSTFLAGS: "-C debug-assertions"
 
 jobs:
-  check_draft_pr:
-    runs-on: ubuntu-latest
-    steps:
-      - name: Check if PR is a draft
-        run: |
-          if [ "${{ github.event.pull_request.draft }}" == "true" ]; then
-            echo "PR is a draft. CI will not proceed."
-            exit 1  # Abort the CI job
-          else
-            echo "PR is not a draft. Proceeding with CI."
-          fi
 
   changes:
-    needs: check_draft_pr
+    if: github.event.pull_request.draft == false
     runs-on: ubuntu-latest
     permissions:
       pull-requests: read
diff --git a/.github/workflows/miri-check.yml b/.github/workflows/miri-check.yml
index 0ddc4de9a..75eea2455 100644
--- a/.github/workflows/miri-check.yml
+++ b/.github/workflows/miri-check.yml
@@ -5,10 +5,12 @@ on:
     branches: [ main ]
   pull_request:
     branches: [ main, release* ]
+    types: [ opened, ready_for_review, reopened, synchronize ]
 
 jobs:
   miri:
     name: "Miri"
+    if: github.event.pull_request.draft == false
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
@@ -23,4 +25,4 @@ jobs:
       - name: List all changed files
         env:
           ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
-        run: ./internal/scripts/ci_run_miri.sh  
\ No newline at end of file
+        run: ./internal/scripts/ci_run_miri.sh  

From d6dfbf3b275dd201470c38c873a0f3a0928d94cc Mon Sep 17 00:00:00 2001
From: Mathias Kraus <elboberido@m-hias.de>
Date: Wed, 4 Dec 2024 14:43:56 +0100
Subject: [PATCH 2/2] [#3] No line breaks for bullet lists

---
 .github/PULL_REQUEST_TEMPLATE.md | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index b47169837..77ef92614 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,29 +1,23 @@
-<!-- markdownlint-disable MD041 first-line-heading/first-line-h1 -->
+<!-- markdownlint-disable MD013 Line breaks on the bullet list lines are also present on the github renderer, therefore no line length limitation -->
+<!-- markdownlint-disable MD041 On the github PR template we want to start with '## Headline' -->
 
 ## Notes for Reviewer
 <!-- Items in addition to the checklist below that the reviewer should look for -->
 
-## Prevent CI from running on each commit while the work is still in progress
-
-* Set the PR to a draft status, e.g. by the `Convert to draft` link, to indicate
-that the work is not yet ready for review
-* Once the PR is ready for review, press the `Ready for Review` button to
-trigger the CI
-
 ## Pre-Review Checklist for the PR Author
 
 * [ ] Add sensible notes for the reviewer
 * [ ] PR title is short, expressive and meaningful
+* [ ] Consider switching the PR to a draft (`Convert to draft`)
+    * as draft PR, the CI will be skipped for pushes
 * [ ] Relevant issues are linked in the [References](#references) section
-* [ ] Every source code file has a copyright header with
-`SPDX-License-Identifier: Apache-2.0 OR MIT`
+* [ ] Every source code file has a copyright header with `SPDX-License-Identifier: Apache-2.0 OR MIT`
 * [ ] Branch follows the naming format (`iox2-123-introduce-posix-ipc-example`)
 * [ ] Commits messages are according to this [guideline][commit-guidelines]
     * [ ] Commit messages have the issue ID (`[#123] Add posix ipc example`)
     * [ ] Commit author matches [Eclipse Contributor Agreement][eca](and ECA is signed)
 * [ ] Tests follow the [best practice for testing][testing]
-* [ ] Changelog updated [in the unreleased section][changelog] including API
-breaking changes
+* [ ] Changelog updated [in the unreleased section][changelog] including API breaking changes
 * [ ] Assign PR to reviewer
 * [ ] All checks have passed (except `task-list-completed`)
 
@@ -45,9 +39,9 @@ breaking changes
 
 ## References
 
-<!-- Use either 'Closes #123' or 'Relates to #123' to reference the corresponding
-issue. -->
+<!-- Use either 'Closes #123' or 'Relates to #123' to reference the corresponding issue. -->
 
 Closes # <!-- Add issue number after '#' -->
 
 <!-- markdownlint-enable MD041 -->
+<!-- markdownlint-enable MD013 -->