Skip to content

Commit ed491de

Browse files
authored
Merge pull request #22 from zeroedin/chore/brute-force-release-branch
chore: create release branch on release workflow as a step
2 parents 82855ae + b27e52f commit ed491de

File tree

2 files changed

+7
-50
lines changed

2 files changed

+7
-50
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,14 @@ jobs:
3333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3434
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3535
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36-
create-tag:
37-
needs: release
38-
if: github.repository == 'zeroedin/z-changeset-practice'
39-
runs-on: ubuntu-latest
40-
steps:
41-
- uses: actions/checkout@v3
42-
with:
43-
token: ${{ secrets.GITHUB_TOKEN }}
44-
- uses: actions/setup-node@v3
45-
with:
46-
node-version-file: .nvmrc
47-
- run: npm ci --prefer-offline
48-
- name: Create and push git tag
36+
37+
- name: Create release branch
4938
run: |
50-
PACKAGE_VERSION=$(node -p "require('./package.json').version")
5139
TAG_NAME="v$PACKAGE_VERSION"
40+
RELEASE_BRANCH="release/${TAG_NAME}"
5241
53-
git config user.name "github-actions[bot]"
54-
git config user.email "github-actions[bot]@users.noreply.github.com"
42+
# Create and push release branch
43+
git checkout -b "$RELEASE_BRANCH"
44+
git push origin "$RELEASE_BRANCH"
5545
56-
# Create tag only if it doesn't exist
57-
if ! git tag -l | grep -q "^$TAG_NAME$"; then
58-
git tag "$TAG_NAME"
59-
git push origin "$TAG_NAME"
60-
else
61-
echo "Tag $TAG_NAME already exists, skipping..."
62-
fi
46+
echo "Created release branch: $RELEASE_BRANCH"

.github/workflows/tag-processing.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)