2024-11-10 01:16:21 +00:00
|
|
|
# Copyright 2024 The Forgejo Authors
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2024-11-17 13:40:36 +00:00
|
|
|
name: issue-labels
|
2024-11-10 01:16:21 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types:
|
|
|
|
- labeled
|
|
|
|
- edited
|
|
|
|
- opened
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
merge-conditions:
|
2024-11-17 13:40:36 +00:00
|
|
|
if: >
|
|
|
|
vars.ROLE == 'forgejo-coding' &&
|
|
|
|
|
|
|
|
github.event_name == 'pull_request' &&
|
|
|
|
(
|
|
|
|
github.event.action == 'label_updated' ||
|
|
|
|
github.event.action == 'edited' ||
|
|
|
|
github.event.action == 'opened'
|
|
|
|
)
|
2024-11-10 01:16:21 +00:00
|
|
|
runs-on: docker
|
|
|
|
container:
|
|
|
|
image: 'code.forgejo.org/oci/node:20-bookworm'
|
|
|
|
steps:
|
2024-11-17 13:40:36 +00:00
|
|
|
- name: Debug info
|
2024-11-10 01:16:21 +00:00
|
|
|
run: |
|
|
|
|
cat <<'EOF'
|
2024-11-17 13:40:36 +00:00
|
|
|
${{ toJSON(github) }}
|
2024-11-10 01:16:21 +00:00
|
|
|
EOF
|
|
|
|
- name: Missing test label
|
|
|
|
if: >
|
|
|
|
!(
|
|
|
|
contains(toJSON(github.event.pull_request.labels), 'test/present')
|
|
|
|
|| contains(toJSON(github.event.pull_request.labels), 'test/not-needed')
|
|
|
|
|| contains(toJSON(github.event.pull_request.labels), 'test/manual')
|
|
|
|
)
|
|
|
|
run: |
|
|
|
|
echo "Test label must be set to either 'present', 'not-needed' or 'manual'."
|
|
|
|
exit 1
|
|
|
|
- name: Missing manual test instructions
|
|
|
|
if: >
|
|
|
|
(
|
|
|
|
contains(toJSON(github.event.pull_request.labels), 'test/manual')
|
|
|
|
&& !contains(toJSON(github.event.pull_request.body), '# Test')
|
|
|
|
)
|
|
|
|
run: |
|
|
|
|
echo "Manual test label is set. The PR description needs to contain test steps introduced by a heading like:"
|
|
|
|
echo "# Testing"
|
|
|
|
exit 1
|