chore(workflows): refine branch handling in release process
- Adjusts workflow to support pushes from all branches - Ensures main branch-specific conditions for version detection - Modifies changelog and release steps for non-main branch handling
This commit is contained in:
@@ -4,10 +4,12 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- '**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
detect-version-change:
|
detect-version-change:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
outputs:
|
outputs:
|
||||||
version_changed: ${{ steps.check.outputs.version_changed }}
|
version_changed: ${{ steps.check.outputs.version_changed }}
|
||||||
steps:
|
steps:
|
||||||
@@ -35,7 +37,7 @@ jobs:
|
|||||||
|
|
||||||
changelog-only:
|
changelog-only:
|
||||||
needs: detect-version-change
|
needs: detect-version-change
|
||||||
if: needs.detect-version-change.outputs.version_changed == 'false'
|
if: github.ref != 'refs/heads/main' || needs.detect-version-change.outputs.version_changed == 'false'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -75,12 +77,12 @@ jobs:
|
|||||||
echo "No changes to commit"
|
echo "No changes to commit"
|
||||||
else
|
else
|
||||||
git commit -m "chore(changelog): update unreleased changelog"
|
git commit -m "chore(changelog): update unreleased changelog"
|
||||||
git push origin main
|
git push origin "${GITHUB_REF##refs/heads/}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: detect-version-change
|
needs: detect-version-change
|
||||||
if: needs.detect-version-change.outputs.version_changed == 'true'
|
if: needs.detect-version-change.outputs.version_changed == 'true' && github.ref == 'refs/heads/main'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
Reference in New Issue
Block a user