File: commits.yml

package info (click to toggle)
distrobuilder 3.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,468 kB
  • sloc: sh: 204; makefile: 75
file content (40 lines) | stat: -rw-r--r-- 934 bytes parent folder | download | duplicates (2)
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
name: Commits
on:
  - pull_request

permissions:
  contents: read

jobs:
  dco-check:
    permissions:
      pull-requests: read  # for tim-actions/get-pr-commits to get list of commits from the PR
    name: Signed-off-by (DCO)
    runs-on: ubuntu-latest
    steps:
    - name: Get PR Commits
      id: 'get-pr-commits'
      uses: tim-actions/get-pr-commits@master
      with:
        token: ${{ secrets.GITHUB_TOKEN }}

    - name: Check that all commits are signed-off
      uses: tim-actions/dco@master
      with:
        commits: ${{ steps.get-pr-commits.outputs.commits }}

  target-branch:
    permissions:
      contents: none
    name: Branch target
    runs-on: ubuntu-latest
    steps:
    - name: Check branch target
      env:
        TARGET: ${{ github.event.pull_request.base.ref }}
      run: |
        set -x
        [ "${TARGET}" = "main" ] && exit 0

        echo "Invalid branch target: ${TARGET}"
        exit 1