1- name : Rebase EIP Branch
2- description : Rebases an EIP branch onto a fork branch
1+ name : Rebase EIP Branches
2+ description : Rebases EIP branches onto a fork branch
33inputs :
44 fork :
55 description : ' Fork name (e.g., amsterdam)'
66 required : true
7- eip_number :
8- description : ' EIP number'
7+ default : ' amsterdam'
8+ eip_numbers :
9+ description : ' List of EIP numbers (e.g., 1234,2345+3456 for eip-1234 and combined eip-2345+3456)'
910 required : true
1011runs :
1112 using : " composite"
@@ -16,18 +17,17 @@ runs:
1617 git config user.name "github-actions[bot]"
1718 git config user.email "github-actions[bot]@users.noreply.github.com"
1819
19- - name : Rebase EIP branch (create if missing)
20+ - name : Rebase EIP branches (create if missing)
2021 shell : bash
2122 env :
2223 FORK : ${{ inputs.fork }}
23- EIP_NUMBER : ${{ inputs.eip_number }}
24+ EIP_NUMBERS : ${{ inputs.eip_numbers }}
2425 REMOTE : origin
2526 run : |
2627 set -euo pipefail
2728
2829 echo "FORK=$FORK"
29- echo "EIP_NUMBER=$EIP_NUMBER"
30- EIP_BRANCH="eips/${FORK}/eip-${EIP_NUMBER}"
30+ echo "EIP_NUMBERS=$EIP_NUMBERS"
3131 FORK_BRANCH="forks/${FORK}"
3232
3333 git fetch "${REMOTE}" --prune
@@ -38,37 +38,69 @@ runs:
3838 exit 1
3939 fi
4040
41- # Create local branch from remote if it exists, else create from fork base
42- if git show-ref --verify --quiet "refs/remotes/${REMOTE}/${EIP_BRANCH}"; then
43- echo "Checking out existing ${EIP_BRANCH} (tracking ${REMOTE})"
44- git checkout -B "${EIP_BRANCH}" "${REMOTE}/${EIP_BRANCH}"
45- else
46- echo "Branch ${EIP_BRANCH} does not exist on ${REMOTE}; creating from ${REMOTE}/${FORK_BRANCH}"
47- git checkout -B "${EIP_BRANCH}" "${REMOTE}/${FORK_BRANCH}"
41+ # Convert comma-separated list to array
42+ IFS=',' read -ra RAW_EIPS <<< "$EIP_NUMBERS"
4843
49- # First push creates the remote branch (no force needed)
50- git push -u "${REMOTE}" "${EIP_BRANCH}"
51- fi
44+ # Normalize: trim whitespace, drop empties, validate
45+ EIPS=()
46+ for raw in "${RAW_EIPS[@]}"; do
47+ eip="$(echo "$raw" | xargs)" # trims leading/trailing whitespace
48+ if [[ -n "$eip" ]]; then
49+ # Ensure it looks like EIP number(s) - digits optionally joined by +
50+ if [[ ! "$eip" =~ ^[0-9]+(\+[0-9]+)*$ ]]; then
51+ echo "Error: Invalid EIP number ${eip}"
52+ exit 1
53+ fi
54+ EIPS+=("$eip")
55+ fi
56+ done
5257
53- echo "Rebasing ${EIP_BRANCH} onto ${REMOTE}/${FORK_BRANCH}"
54- if ! git rebase "${REMOTE}/${FORK_BRANCH}"; then
55- echo "Error: Rebase conflict occurred while rebasing ${EIP_BRANCH} onto ${FORK_BRANCH}"
56- git rebase --abort || true
58+ if [[ ${#EIPS[@]} -eq 0 ]]; then
59+ echo "Error: No EIP numbers provided after parsing '${EIP_NUMBERS}'"
5760 exit 1
5861 fi
5962
60- echo "Running static checks on rebased branch"
61- uvx --with=tox-uv tox -e static
63+ for EIP_NUMBER in "${EIPS[@]}"; do
64+ EIP_BRANCH="eips/${FORK}/eip-${EIP_NUMBER}"
65+
66+ # Create local branch from remote if it exists, else create from fork base
67+ if git show-ref --verify --quiet "refs/remotes/${REMOTE}/${EIP_BRANCH}"; then
68+ echo "Checking out existing ${EIP_BRANCH} (tracking ${REMOTE})"
69+ git checkout -B "${EIP_BRANCH}" "${REMOTE}/${EIP_BRANCH}"
70+ else
71+ echo "Branch ${EIP_BRANCH} does not exist on ${REMOTE}; creating from ${REMOTE}/${FORK_BRANCH}"
72+ git checkout -B "${EIP_BRANCH}" "${REMOTE}/${FORK_BRANCH}"
73+
74+ # First push creates the remote branch (no force needed)
75+ git push -u "${REMOTE}" "${EIP_BRANCH}"
76+ fi
77+
78+ echo "Rebasing ${EIP_BRANCH} onto ${REMOTE}/${FORK_BRANCH}"
79+ if ! git rebase "${REMOTE}/${FORK_BRANCH}"; then
80+ echo "Error: Rebase conflict occurred while rebasing ${EIP_BRANCH} onto ${FORK_BRANCH}"
81+ git rebase --abort || true
82+ exit 1
83+ fi
84+
85+ echo "Rebase of ${EIP_BRANCH} successful"
6286
63- echo "Rebase successful"
87+ echo "Running static checks on ${EIP_BRANCH}"
88+ uvx --with=tox-uv tox -e static
89+ done
6490
65- - name : Push rebased branch
91+ - name : Push rebased branches
6692 shell : bash
6793 env :
6894 FORK : ${{ inputs.fork }}
69- EIP_NUMBER : ${{ inputs.eip_number }}
95+ EIP_NUMBERS : ${{ inputs.eip_numbers }}
7096 REMOTE : origin
7197 run : |
72- EIP_BRANCH="eips/${FORK}/eip-${EIP_NUMBER}"
73- echo "Force pushing ${EIP_BRANCH} to ${REMOTE}"
74- git push --force-with-lease "${REMOTE}" "${EIP_BRANCH}"
98+ IFS=',' read -ra RAW_EIPS <<< "$EIP_NUMBERS"
99+ for raw in "${RAW_EIPS[@]}"; do
100+ eip="$(echo "$raw" | xargs)"
101+ if [[ -n "$eip" ]]; then
102+ EIP_BRANCH="eips/${FORK}/eip-${eip}"
103+ echo "Force pushing ${EIP_BRANCH} to ${REMOTE}"
104+ git push --force-with-lease "${REMOTE}" "${EIP_BRANCH}"
105+ fi
106+ done
0 commit comments