Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit 646d604

Browse files
authored
FIX: push to v1 etc for version branches (#18)
1 parent 425dd92 commit 646d604

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

.github/workflows/cd.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,24 @@ jobs:
1010
milestone:
1111
if: startsWith(github.ref, 'refs/tags')
1212
uses: ComPWA/actions/.github/workflows/close-milestone.yml@v1
13-
push:
13+
push-to-version-branches:
14+
name: Push to version branches
1415
if: startsWith(github.ref, 'refs/tags') && !github.event.release.prerelease
15-
secrets: inherit
16-
uses: ComPWA/actions/.github/workflows/push-to-version-branches.yml@v1
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Configure Git credentials
20+
run: |
21+
git config --global user.name "GitHub Action"
22+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
23+
- name: Push to matching minor version branch
24+
env:
25+
TAG: ${{ github.ref_name }}
26+
run: |
27+
re='^(v?)([0-9]+)\.([0-9]+)\.[0-9]+'
28+
if [[ $TAG =~ $re ]]; then
29+
MAJOR_VERSION="${BASH_REMATCH[2]}"
30+
MINOR_VERSION="${BASH_REMATCH[2]}.${BASH_REMATCH[3]}"
31+
git push origin HEAD:refs/heads/v$MAJOR_VERSION --force
32+
git push origin HEAD:refs/heads/v$MINOR_VERSION --force
33+
fi

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ repos:
2121
- --no-notebooks
2222
- --no-prettierrc
2323
- --no-pypi
24+
- --no-version-branches
2425
- --pytest-single-threaded
2526
- --repo-name=update-pip-constraints
2627
- id: format-setup-cfg

0 commit comments

Comments
 (0)