瀏覽代碼

[ci] check target branch for PRs

Rudy Ges 1 年之前
父節點
當前提交
c2724bfdda
共有 1 個文件被更改,包括 19 次插入0 次删除
  1. 19 0
      .github/workflows/target.yml

+ 19 - 0
.github/workflows/target.yml

@@ -0,0 +1,19 @@
+name: Check pull request target branch
+on:
+  pull_request_target:
+    types:
+      - opened
+      - reopened
+      - synchronize
+      - edited
+jobs:
+  check-branches:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Check branches
+        run: |
+          if [ ${{ github.base_ref }} != "development" ]; then
+            echo "Merge requests should target `development`."
+            exit 1
+          fi
+