Skip to content

Update main.yml

Update main.yml #9

Workflow file for this run

# .github/workflows/bump-version.yml
name: Auto Bump Version
on:
push:
branches:
- 'main'
permissions:
contents: write
pull-requests: write
jobs:
bump:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Node dependencies
working-directory: MyMusicClientSveltePwa
run: npm ci
- name: Bump version
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
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
- name: Create new branch and push
run: |
git checkout -b ${{ env.BRANCH_NAME }}
git push origin ${{ env.BRANCH_NAME }}
- 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