zephyr/.github/workflows/pr_metadata_check.yml
Fabio Baltieri 649eb6280d ci: pr_metadata_check: convert DNM logic to python
GitHub seems to have issue with workflow state caching that causes the
DNM step to not work properly in few cases and not detecting changes in
the DNM tag, forcing people to mess with tags or close/opening PRs,
which in turns restarts all workflows.

Convert the script to Python so that the tag data is guaranteed to be
fresh.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-05-20 10:17:19 +02:00

48 lines
1.1 KiB
YAML

name: PR Metadata Check
on:
pull_request:
types:
- synchronize
- opened
- reopened
- labeled
- unlabeled
- edited
permissions:
contents: read
jobs:
do-not-merge:
name: Prevent Merging
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: 3.12
cache: pip
cache-dependency-path: scripts/requirements-actions.txt
- name: Install Python dependencies
run: |
pip install -r scripts/requirements-actions.txt --require-hashes
- name: Run the check script
run: |
./scripts/ci/do_not_merge.py -p "${{ github.event.pull_request.number }}"
empty_pr_description:
if: ${{ github.event.pull_request.body == '' }}
name: PR Description
runs-on: ubuntu-24.04
steps:
- name: Check for PR description
run: |
echo "Pull request description cannot be empty."
exit 1