summaryrefslogtreecommitdiffstats
path: root/.forgejo/workflows/merge-requirements.yml
blob: d8a9618d2a00de90bd287902cb6ec890b5f028c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright 2024 The Forgejo Authors
# SPDX-License-Identifier: MIT

name: requirements

on:
  pull_request:
    types:
      - labeled
      - edited
      - opened
      - synchronize

jobs:
  merge-conditions:
    if: vars.ROLE == 'forgejo-coding'
    runs-on: docker
    container:
      image: 'code.forgejo.org/oci/node:20-bookworm'
    steps:
      - name: Debug output
        run: |
          cat <<'EOF'
          ${{ toJSON(github) }}
          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