feat(workflows): conditionally generate changelog
- Add logic to generate changelog only if the file exists or on the main branch - Prevent unnecessary changelog generation in other contexts
This commit is contained in:
@@ -71,8 +71,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cargo install git-cliff --version "${{ steps.cliff_version.outputs.version }}" --features gitea
|
cargo install git-cliff --version "${{ steps.cliff_version.outputs.version }}" --features gitea
|
||||||
|
|
||||||
- name: Generate unreleased changelog
|
- name: Generate unreleased changelog (if file exists or on main)
|
||||||
run: git-cliff -c cliff.toml -o CHANGELOG.md
|
run: |
|
||||||
|
if [[ -f CHANGELOG.md || "${GITHUB_REF##refs/heads/}" == "main" ]]; then
|
||||||
|
echo "Generating CHANGELOG.md..."
|
||||||
|
git-cliff -c cliff.toml -o CHANGELOG.md
|
||||||
|
else
|
||||||
|
echo "CHANGELOG.md does not exist and this is not 'main'. Skipping generation."
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Commit updated CHANGELOG
|
- name: Commit updated CHANGELOG
|
||||||
run: |
|
run: |
|
||||||
|
Reference in New Issue
Block a user