2025-08-18 15:20:40 +02:00
|
|
|
# Copyright 2025 The Forgejo Authors
|
2024-12-06 11:05:00 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
|
|
name: requirements
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
pull_request:
|
|
|
|
|
types:
|
|
|
|
|
- labeled
|
|
|
|
|
- edited
|
|
|
|
|
- opened
|
|
|
|
|
- synchronize
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
merge-conditions:
|
2025-08-18 15:20:40 +02:00
|
|
|
if: >
|
|
|
|
|
vars.ROLE == 'forgejo-coding' && forge.event.pull_request.head.repo.full_name != 'forgejo-cascading-pr/forgejo'
|
2024-12-06 11:05:00 +00:00
|
|
|
runs-on: docker
|
|
|
|
|
container:
|
2025-11-13 15:28:31 +01:00
|
|
|
image: 'data.forgejo.org/oci/node:24-bookworm'
|
2024-12-06 11:05:00 +00:00
|
|
|
steps:
|
|
|
|
|
- name: Debug output
|
|
|
|
|
run: |
|
|
|
|
|
cat <<'EOF'
|
2024-12-06 06:03:51 +01:00
|
|
|
${{ toJSON(github) }}
|
2024-12-06 11:05:00 +00:00
|
|
|
EOF
|
|
|
|
|
- name: Missing test label
|
|
|
|
|
if: >
|
|
|
|
|
!(
|
2025-08-18 15:20:40 +02:00
|
|
|
contains(toJSON(forge.event.pull_request.labels), 'test/present')
|
|
|
|
|
|| contains(toJSON(forge.event.pull_request.labels), 'test/not-needed')
|
|
|
|
|
|| contains(toJSON(forge.event.pull_request.labels), 'test/manual')
|
2024-12-06 11:05:00 +00:00
|
|
|
)
|
|
|
|
|
run: |
|
2025-05-01 11:52:22 +00:00
|
|
|
echo "A team member must set the label to either 'present', 'not-needed' or 'manual'."
|
2024-12-06 11:05:00 +00:00
|
|
|
exit 1
|
|
|
|
|
- name: Missing manual test instructions
|
|
|
|
|
if: >
|
|
|
|
|
(
|
2025-08-18 15:20:40 +02:00
|
|
|
contains(toJSON(forge.event.pull_request.labels), 'test/manual')
|
|
|
|
|
&& !contains(toJSON(forge.event.pull_request.body), '# Test')
|
2024-12-06 11:05:00 +00:00
|
|
|
)
|
|
|
|
|
run: |
|
|
|
|
|
echo "Manual test label is set. The PR description needs to contain test steps introduced by a heading like:"
|
|
|
|
|
echo "# Testing"
|
|
|
|
|
exit 1
|