File tree Expand file tree Collapse file tree 3 files changed +88
-1
lines changed
Expand file tree Collapse file tree 3 files changed +88
-1
lines changed Original file line number Diff line number Diff line change 1+ # Fast Forward Check Workflow
2+ # This workflow validates pull requests with the 'fast-forward' label to ensure they follow
3+ # the correct branch hierarchy before allowing fast-forward merging:
4+ # - PRs targeting 'bepolia' must come from 'devel' branch
5+ # - PRs targeting 'main' must come from 'bepolia' branch
6+ # The workflow runs on PR events and validates branch structure without merging.
7+
8+ name : check-fast-forward
9+ on :
10+ pull_request :
11+ types : [opened, edited, labeled, synchronize]
12+ branches :
13+ - main
14+ - bepolia
15+ jobs :
16+ check-fast-forward :
17+ runs-on : ubuntu-latest
18+
19+ if : ${{ contains(github.event.pull_request.labels.*.name, 'fast-forward') }}
20+
21+ permissions :
22+ contents : write
23+ pull-requests : write
24+ issues : write
25+
26+ steps :
27+ - name : Validate branches
28+ run : |
29+ echo "GITHUB_BASE_REF: $GITHUB_BASE_REF"
30+ echo "GITHUB_HEAD_REF: $GITHUB_HEAD_REF"
31+ if [ "$GITHUB_BASE_REF" == "bepolia" ] && [ "$GITHUB_HEAD_REF" != "devel" ]; then
32+ echo "Error: When targeting bepolia branch, head branch must be devel"
33+ exit 1
34+ elif [ "$GITHUB_BASE_REF" == "main" ] && [ "$GITHUB_HEAD_REF" != "bepolia" ]; then
35+ echo "Error: When targeting main branch, head branch must be bepolia"
36+ exit 1
37+ fi
38+
39+ - name : Fast forwarding
40+ uses : sequoia-pgp/fast-forward@v1
41+ with :
42+ merge : false
43+ comment : on-error # always | never | on-error
Original file line number Diff line number Diff line change 1+ # Fast Forward Workflow
2+ # This workflow automatically fast-forwards pull requests with the 'fast-forward' label
3+ # when they receive an approved review. It ensures proper branch hierarchy:
4+ # - PRs targeting 'bepolia' must come from 'devel' branch
5+ # - PRs targeting 'main' must come from 'bepolia' branch
6+ # The workflow uses sequoia-pgp/fast-forward action to merge changes automatically.
7+
8+ name : execute-fast-forward
9+ on :
10+ pull_request_review :
11+ types : [submitted]
12+ branches :
13+ - main
14+ - bepolia
15+ jobs :
16+ execute-fast-forward :
17+ runs-on : ubuntu-latest
18+
19+ if :
20+ ${{ contains(github.event.pull_request.labels.*.name, 'fast-forward') && github.event.review.state == 'approved'
21+ }}
22+
23+ permissions :
24+ contents : write
25+ pull-requests : write
26+ issues : write
27+
28+ steps :
29+ - name : Validate branches
30+ run : |
31+ echo "GITHUB_BASE_REF: ${{ github.event.pull_request.base.ref }}"
32+ echo "GITHUB_HEAD_REF: ${{ github.event.pull_request.head.ref }}"
33+ if [ ${{ github.event.pull_request.base.ref }} == "bepolia" ] && [ ${{ github.event.pull_request.head.ref }} != "devel" ]; then
34+ echo "Error: When targeting bepolia branch, head branch must be devel"
35+ exit 1
36+ elif [ ${{ github.event.pull_request.base.ref }} == "main" ] && [ ${{ github.event.pull_request.head.ref }} != "bepolia" ]; then
37+ echo "Error: When targeting main branch, head branch must be bepolia"
38+ exit 1
39+ fi
40+ - name : Fast forwarding
41+ uses : sequoia-pgp/fast-forward@v1
42+ with :
43+ merge : true
44+ comment : on-error # always | never | on-error
Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main
7- - devel
87 - bepolia
8+ - devel
99
1010jobs :
1111 test :
You can’t perform that action at this time.
0 commit comments