CI: Ensure changelogs are prettified prior to commit (#92580)

* Ensure changelogs are prettified prior to commit

* Remove cache property

* Include .yarn directory

* Include packages directory

* Try just using npx

* Update workflows
This commit is contained in:
Andreas Christou 2024-09-04 11:03:17 +01:00 committed by GitHub
parent 14e1403b9e
commit 8daa6f1f30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 3 deletions

View File

@ -74,8 +74,15 @@ jobs:
sparse-checkout: |
.github/workflows
CHANGELOG.md
.nvmrc
.prettierignore
.prettierrc.js
fetch-depth: 0
fetch-tags: true
- name: Setup nodejs environment
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: "Configure git user"
run: |
git config --local user.name "github-actions[bot]"
@ -120,9 +127,11 @@ jobs:
fi
git diff CHANGELOG.md
git add CHANGELOG.md
- name: "Prettify CHANGELOG.md"
run: npx prettier --write CHANGELOG.md
- name: "Commit changelog changes"
run: git commit --allow-empty -m "Update changelog" CHANGELOG.md
run: git add CHANGELOG.md && git commit --allow-empty -m "Update changelog" CHANGELOG.md
- name: "git push"
if: ${{ inputs.dry_run }} != true
run: git push

View File

@ -74,6 +74,10 @@ jobs:
fetch-depth: '0'
fetch-tags: 'false'
path: .grafana-main
- name: Setup nodejs environment
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Configure git user
run: |
git config --local user.name "github-actions[bot]"
@ -120,7 +124,9 @@ jobs:
rm -f CHANGELOG.part changelog_items.md
git diff CHANGELOG.md
- name: "Prettify CHANGELOG.md"
run: npx prettier --write CHANGELOG.md
- name: Commit CHANGELOG.md changes
run: git add CHANGELOG.md && git commit --allow-empty -m "Update changelog" CHANGELOG.md