From 2483dbc694f2cdc7e29ac7c32909041fb638bd33 Mon Sep 17 00:00:00 2001 From: Otto Richter Date: Sun, 10 Nov 2024 02:16:21 +0100 Subject: [PATCH] chore(ci): Enforce test label with CI check Re-add the test after bugfixes have been deployed to Codeberg --- .forgejo/workflows/merge-requirements.yml | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .forgejo/workflows/merge-requirements.yml diff --git a/.forgejo/workflows/merge-requirements.yml b/.forgejo/workflows/merge-requirements.yml new file mode 100644 index 0000000000..d9650b66a7 --- /dev/null +++ b/.forgejo/workflows/merge-requirements.yml @@ -0,0 +1,44 @@ +# Copyright 2024 The Forgejo Authors +# SPDX-License-Identifier: MIT + +name: requirements + +on: + pull_request: + types: + - labeled + - edited + - opened + - synchronize + +jobs: + merge-conditions: + runs-on: docker + container: + image: 'code.forgejo.org/oci/node:20-bookworm' + steps: + - name: Debug output + run: | + cat <<'EOF' + ${{ toJSON(github.event) }} + 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