| 1 |
name: Commits |
| 2 |
on: |
| 3 |
- pull_request |
| 4 |
|
| 5 |
permissions: |
| 6 |
contents: read |
| 7 |
|
| 8 |
jobs: |
| 9 |
dco-check: |
| 10 |
permissions: |
| 11 |
pull-requests: read |
| 12 |
name: Signed-off-by (DCO) |
| 13 |
runs-on: ubuntu-20.04 |
| 14 |
steps: |
| 15 |
- name: Get PR Commits |
| 16 |
id: 'get-pr-commits' |
| 17 |
uses: tim-actions/get-pr-commits@master |
| 18 |
with: |
| 19 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 20 |
|
| 21 |
- name: Check that all commits are signed-off |
| 22 |
uses: tim-actions/dco@master |
| 23 |
with: |
| 24 |
commits: ${{ steps.get-pr-commits.outputs.commits }} |
| 25 |
|
| 26 |
target-branch: |
| 27 |
permissions: |
| 28 |
contents: none |
| 29 |
name: Branch target |
| 30 |
runs-on: ubuntu-20.04 |
| 31 |
steps: |
| 32 |
- name: Check branch target |
| 33 |
env: |
| 34 |
TARGET: ${{ github.event.pull_request.base.ref }} |
| 35 |
run: | |
| 36 |
set -x |
| 37 |
[ "${TARGET}" = "main" ] && exit 0 |
| 38 |
|
| 39 |
echo "Invalid branch target: ${TARGET}" |
| 40 |
exit 1 |