File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 3636 - name : Install dependencies
3737 run : bun install
3838
39+ - name : Check proposal matches PR number
40+ run : |
41+ BASE_SHA="${{ github.event.pull_request.base.sha }}"
42+ HEAD_SHA="${{ github.event.pull_request.head.sha }}"
43+ PR_NUMBER="${{ github.event.pull_request.number }}"
44+
45+ CHANGED_PROPOSALS=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" -- 'proposals/' \
46+ | grep -v '^proposals/0000-template\.md$' || true)
47+
48+ COUNT=$(echo "$CHANGED_PROPOSALS" | grep -c . || true)
49+
50+ if [ "$COUNT" -gt 1 ]; then
51+ echo "::error::PR touches $COUNT proposals. Only one proposal per PR is allowed."
52+ echo "$CHANGED_PROPOSALS"
53+ exit 1
54+ fi
55+
56+ if [ "$COUNT" -eq 1 ]; then
57+ FILE=$(echo "$CHANGED_PROPOSALS" | head -1)
58+ FILENAME=$(basename "$FILE")
59+ FILE_NUMBER=$(echo "$FILENAME" | grep -oE '^[0-9]+' || true)
60+ # Strip leading zeros for comparison
61+ FILE_NUM=$((10#$FILE_NUMBER))
62+
63+ if [ "$FILE_NUM" -ne "$PR_NUMBER" ]; then
64+ echo "::error::Proposal number ($FILE_NUM from $FILENAME) does not match PR number ($PR_NUMBER)."
65+ exit 1
66+ fi
67+ fi
68+
3969 - name : Build
4070 run : bun run build
You can’t perform that action at this time.
0 commit comments