Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 20 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
name: Auto Bump Version

on:
push:
branches:
- '!main'
pull_request:
branches:
- main
types:
- opened
- synchronize

permissions:
contents: write
Expand All @@ -22,37 +25,27 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install Node dependencies
working-directory: MyMusicClientSveltePwa
run: npm ci

- name: Bump version
- name: Bump version (no commit)
working-directory: MyMusicClientSveltePwa
run: npm version patch --no-git-tag-version

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Commit version bump
# Optional: Commit version bump to the PR branch (not to main)
- name: Commit version bump to PR branch
working-directory: MyMusicClientSveltePwa
run: |
git add MyMusicClientSveltePwa/package.json MyMusicClientSveltePwa/package-lock.json
git commit -m "chore: bump version"
echo "BRANCH_NAME=version-bump-$(date +%s)" >> $GITHUB_ENV
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch origin ${{ github.head_ref }}
git checkout -b temp-pr-branch origin/${{ github.head_ref }}

- name: Create new branch and push
run: |
git checkout -b ${{ env.BRANCH_NAME }}
git push origin ${{ env.BRANCH_NAME }}
git add package.json package-lock.json
git commit -m "chore: bump version"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: bump version"
title: "chore: bump version"
body: "This PR bumps the version automatically."
branch: ${{ env.BRANCH_NAME }}
base: main
git push origin temp-pr-branch:${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions MyMusicClientSveltePwa/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion MyMusicClientSveltePwa/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mymusicclientsveltepwa",
"private": true,
"version": "0.0.1",
"version": "0.0.2",
"type": "module",
"scripts": {
"dev": "vite --host",
Expand Down