]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
github: Validate target branch
authorStéphane Graber <stgraber@ubuntu.com>
Tue, 5 Jul 2022 21:26:42 +0000 (17:26 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 5 Jul 2022 21:26:42 +0000 (17:26 -0400)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
.github/workflows/commits.yml

index 94d906b94d91d9f2972677b3c7cdd85714bc0fd4..57f5d6954acbaf4eb8b8da991b0a1b4dc296f02d 100644 (file)
@@ -22,3 +22,19 @@ jobs:
       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}" = "master" ] && exit 0
+
+        echo "Invalid branch target: ${TARGET}"
+        exit 1