From: Stéphane Graber Date: Thu, 22 Jun 2023 01:45:21 +0000 (-0400) Subject: github: Add DCO/target tests X-Git-Tag: v6.0.0~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=213e2f68d90ed63e6338329daf566a79b64dee76;p=thirdparty%2Flxc.git github: Add DCO/target tests Signed-off-by: Stéphane Graber --- diff --git a/.github/workflows/commits.yml b/.github/workflows/commits.yml new file mode 100644 index 000000000..651c13b37 --- /dev/null +++ b/.github/workflows/commits.yml @@ -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-22.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-22.04 + steps: + - name: Check branch target + env: + TARGET: ${{ github.event.pull_request.base.ref }} + run: | + set -x + [ "${TARGET}" = "master" ] && exit 0 + + echo "Invalid branch target: ${TARGET}" + exit 1