Skip to content

Commit

Permalink
ci(release): update workflow (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
samikachai authored Dec 17, 2024
1 parent 4a1ef2e commit 9e62ce7
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ jobs:
with:
fetch-depth: 0

- name: Create and checkout update-changelog
run: |
BRANCH_NAME="update-changelog"
git checkout -b $BRANCH_NAME
git push -u origin $BRANCH_NAME
- name: Set up Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -38,11 +46,6 @@ jobs:
- name: Update changelog file
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin main
git checkout -b update-changelog origin/main
yarn commitizen init cz-conventional-changelog --save-dev --force --save-exact
HEADER=$(awk '/^---/{exit} {print}' CHANGELOG.md)
yarn conventional-changelog -p angular -o TEMP.md -r 0
Expand All @@ -51,10 +54,6 @@ jobs:
cat TEMP.md >> CHANGELOG.md
rm TEMP.md
echo "Updated CHANGELOG.md:"
cat CHANGELOG.md
git diff || echo "No changes detected"
- name: Fetch initial commit history
id: fetch_initial_commit_history
run: |
Expand Down Expand Up @@ -87,7 +86,10 @@ jobs:
- name: Commit changelog changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md
git restore --source=HEAD --worktree .
git commit -m "chore: update changelog for ${{ github.ref }}"
git push -u origin update-changelog --force
Expand Down

0 comments on commit 9e62ce7

Please sign in to comment.