File tree Expand file tree Collapse file tree 2 files changed +55
-40
lines changed
Expand file tree Collapse file tree 2 files changed +55
-40
lines changed Original file line number Diff line number Diff line change 1+ name : Replicate Commits to Version Branch
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ module_name :
7+ description : ' The name of the module'
8+ required : true
9+ type : string
10+
11+ jobs :
12+ replicate :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout repository
17+ uses : actions/checkout@v2
18+
19+ - name : Set up Python
20+ uses : actions/setup-python@v2
21+ with :
22+ python-version : ' 3.x'
23+
24+ - name : Install dependencies
25+ run : |
26+ python -m pip install --upgrade pip
27+
28+ - name : Get version
29+ id : get_version
30+ run : |
31+ VERSION=$(python -c "
32+ from ${{ inputs.module_name }} import VERSION
33+ print(f'{VERSION[0]}.{VERSION[1]}')
34+ ")
35+ echo "VERSION=$VERSION" >> $GITHUB_ENV
36+
37+ - name : Configure Git
38+ run : |
39+ git config --global user.name 'github-actions[bot]'
40+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
41+
42+ - name : Rebase changes onto version branch
43+ run : |
44+ if git ls-remote --heads origin $VERSION | grep -sw $VERSION; then
45+ git fetch origin --unshallow
46+ git checkout -b $VERSION origin/$VERSION
47+ git rebase origin/master
48+ else
49+ git checkout -b $VERSION
50+ fi
51+ git push origin $VERSION
Original file line number Diff line number Diff line change 66 - master
77
88jobs :
9- replicate :
10- runs-on : ubuntu-latest
11-
12- steps :
13- - name : Checkout repository
14- uses : actions/checkout@v2
15-
16- - name : Set up Python
17- uses : actions/setup-python@v2
18- with :
19- python-version : ' 3.x'
20-
21- - name : Install dependencies
22- run : |
23- python -m pip install --upgrade pip
24-
25- - name : Get version
26- id : get_version
27- run : |
28- VERSION=$(python -c '
29- from openwisp_utils import VERSION
30- print(f"{VERSION[0]}.{VERSION[1]}.x")
31- ')
32- echo "VERSION=$VERSION" >> $GITHUB_ENV
33-
34- - name : Configure Git
35- run : |
36- git config --global user.name 'github-actions[bot]'
37- git config --global user.email 'github-actions[bot]@users.noreply.github.com'
38-
39- - name : Rebase changes onto version branch
40- run : |
41- if git ls-remote --heads origin $VERSION | grep -sw $VERSION; then
42- git fetch origin --unshallow
43- git checkout -b $VERSION origin/$VERSION
44- git rebase origin/master
45- else
46- git checkout -b $VERSION
47- fi
48- git push origin $VERSION
9+ version-branch :
10+ uses : openwisp/openwisp-utils/.github/workflows/reusable-version-branch.yml@master
11+ with :
12+ module_name : openwisp_utils
You can’t perform that action at this time.
0 commit comments