Skip to content

Commit 93c439e

Browse files
committed
github: Add DCO/target tests
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
1 parent aaab3be commit 93c439e

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/commits.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 # for tim-actions/get-pr-commits to get list of commits from the PR
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}" = "master" ] && exit 0
38+
39+
echo "Invalid branch target: ${TARGET}"
40+
exit 1

0 commit comments

Comments
 (0)