Files
git-cliff-action/.github/workflows/sync-git-cliff-version.yml
dependabot[bot] ee508838bd chore(deps): bump actions/checkout from 4.2.2 to 6.0.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 6.0.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v4.2.2...v6.0.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 17:54:29 +00:00

70 lines
2.2 KiB
YAML

name: Sync git-cliff version
on:
schedule:
- cron: '0 3 * * 1' # every Monday at 03:00 UTC
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
check:
name: Check
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2
- name: Get latest git-cliff release
id: latest
run: |
set -euo pipefail
VERSION=$(curl -s https://api.github.com/repos/orhun/git-cliff/releases/latest | jq -r .tag_name)
echo "version=${VERSION}" >> ${GITHUB_OUTPUT}
- name: Read current default version
id: current
run: |
set -euo pipefail
VERSION=$(yq '.inputs.version.default' action.yml)
echo "version=${VERSION}" >> ${GITHUB_OUTPUT}
- name: Bump version
if: steps.latest.outputs.version != steps.current.outputs.version
env:
CURRENT: ${{ steps.current.outputs.version }}
LATEST: ${{ steps.latest.outputs.version }}
run: |
set -euo pipefail
sed -i "s|${CURRENT}|${LATEST}|g" action.yml
sed -i "s|${CURRENT}|${LATEST}|g" README.md
- name: Create PR
if: steps.latest.outputs.version != steps.current.outputs.version
env:
LATEST: ${{ steps.latest.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
BRANCH="chore/git-cliff-${LATEST}"
TITLE="chore: bump git-cliff to ${LATEST}"
BODY="This PR bumps git-cliff to ${LATEST}.
🔗 https://github.com/orhun/git-cliff/releases/tag/${LATEST}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -B "${BRANCH}"
git add action.yml
git add README.md
git commit -m "${TITLE}" || echo "Nothing to commit"
git push origin "${BRANCH}" --force
echo "${GITHUB_TOKEN}" | gh auth login --with-token
gh pr create \
--base main \
--head "${BRANCH}" \
--title "${TITLE}" \
--body "${BODY}" \
|| echo "PR already exists"