Skip to content

Add auto-update changelog workflow using docker image #16

Add auto-update changelog workflow using docker image

Add auto-update changelog workflow using docker image #16

name: Auto-update changelog
on:
pull_request: {}
permissions: {}
jobs:
report:
runs-on: ubuntu-latest
permissions:
contents: write # To push commits
pull-requests: write # To comment in PR
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # We need the full history to compare changes
persist-credentials: true # For the next step
- name: Update changelog
uses: docker://gsoci.azurecr.io/giantswarm/claude-code-ci:0.0.0-6f5ffbab0866222ac6305cb00f5b61c1b494d50c
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CLAUDE_OUTPUT_FORMAT: text
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_AUTHOR_NAME: ${{ github.event.pull_request.user.name }}
PR_BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
PR_BRANCH: ${{ github.head_ref }}
PR_CHANGED_FILES: ${{ join(github.event.pull_request.changed_files, ', ') }}
PR_DESCRIPTION: ${{ github.event.pull_request.body }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
REPOSITORY: ${{ github.repository }}
with:
args: |
"You are executed in a Github action runner, in the context of a pull request.
Environment variables give you information about the repository etc.
You have the gh CLI available.
Your task: If a CHANGELOG.md file exists in the repository root, check if the current pull
request updates it.
If CHANGELOG.md exists, but is not updated in this PR, update it with information
about the changes in this branch compared to the default branch. Push a simple commit
to the PR's branch. Do not rebase.
Normally, dependency updates fall under the '### Changed' category. In some cases,
if they are security-related, they might fall under the '### Fixed' category.
Use the pull request title and description for hints. Use `git diff` to find out details about file changes.
Do nothing else. Do not recommend next actions. Finish the given task in one step.
---------------------------------
Pull request details:
- **Title:** '$PR_TITLE'
- **Author:** '$PR_AUTHOR_NAME' (@$PR_AUTHOR)
- **Branch:** '$PR_BRANCH'
- **Base branch:** $PR_BASE_BRANCH
- **PR number:** $PR_NUMBER
- **Repository:** $REPOSITORY
**Changed files:**
$PR_CHANGED_FILES
---------------------------------"