Skip to content

Commit a72b2e4

Browse files
committed
Addressed feedback
1 parent 3f6b3c2 commit a72b2e4

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

.github/workflows/cre-branch-protection.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ name: CRE branch protection
33
on:
44
pull_request:
55
types: [opened, reopened, synchronize]
6+
branches:
7+
- main
68

7-
permissions:
8-
contents: read
9+
permissions: {}
910

1011
jobs:
1112
check-cre-target-branch:
13+
permissions:
14+
contents: read
1215
runs-on: ubuntu-latest
1316
steps:
1417
- uses: actions/checkout@v6
@@ -21,9 +24,9 @@ jobs:
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
@@ -32,11 +35,6 @@ jobs:
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 ""

0 commit comments

Comments
 (0)