Skip to content

Commit

Permalink
github: Add DCO and target check
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Jun 21, 2023
1 parent ad3d9f7 commit 98fa310
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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-20.04
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-20.04
steps:
- name: Check branch target
env:
TARGET: ${{ github.event.pull_request.base.ref }}
run: |
set -x
[ "${TARGET}" = "v2" ] && exit 0
echo "Invalid branch target: ${TARGET}"
exit 1

0 comments on commit 98fa310

Please sign in to comment.