File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,12 +3,15 @@ name: CRE branch protection
33on :
44 pull_request :
55 types : [opened, reopened, synchronize]
6+ branches :
7+ - main
68
7- permissions :
8- contents : read
9+ permissions : {}
910
1011jobs :
1112 check-cre-target-branch :
13+ permissions :
14+ contents : read
1215 runs-on : ubuntu-latest
1316 steps :
1417 - uses : actions/checkout@v6
2124 run : |
2225 git fetch origin "${TARGET_BRANCH}" --quiet 2>/dev/null || true
2326
24- CRE_CHANGED=$(git diff --name-only "origin/${TARGET_BRANCH}" -- cre/)
27+ CRE_CHANGED=$(git diff --name-only "origin/${TARGET_BRANCH}...HEAD " -- cre/)
2528
26- if [ -z "$CRE_CHANGED" ]; then
29+ if [[ -z "$CRE_CHANGED" ] ]; then
2730 echo "No cre/ files modified. Skipping branch check."
2831 exit 0
2932 fi
3235 echo "$CRE_CHANGED"
3336 echo ""
3437
35- if [ "$TARGET_BRANCH" != "main" ]; then
36- echo "PR targets '${TARGET_BRANCH}', not 'main'. CRE changes are allowed."
37- exit 0
38- fi
39-
4038 echo "PR targets 'main' and contains cre/ changes."
4139 echo "Verifying all CRE-modifying commits are cherry-picks from capabilities-development..."
4240 echo ""
You can’t perform that action at this time.
0 commit comments