From aa76a6e95b2c3feef4a57e07fdfb7247c1a55eaf Mon Sep 17 00:00:00 2001 From: Simon Halvorsen Date: Wed, 10 Jun 2026 14:00:39 +0200 Subject: [PATCH] CFE-4659: Added GH-action to automatically generate and send pull-request for changelog Ticket: CFE-4659 Changelog: none Signed-off-by: Simon Halvorsen --- .github/workflows/update-changlog.yml | 57 +++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/update-changlog.yml diff --git a/.github/workflows/update-changlog.yml b/.github/workflows/update-changlog.yml new file mode 100644 index 0000000000..c9412619e3 --- /dev/null +++ b/.github/workflows/update-changlog.yml @@ -0,0 +1,57 @@ +name: Update changelog +permissions: + contents: write + pull-requests: write +on: + workflow_dispatch: + inputs: + branch: + description: 'Version to release (3.24.x, 3.27.x, master)' + required: true + default: 'master' + type: string +jobs: + generate-changelog: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout core + uses: actions/checkout@v3 + with: + fetch-tags: true + fetch-depth: 0 + path: repos/core + repository: cfengine/core + ref: ${{ inputs.branch }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install cfengine-cli + run: | + pip install git+https://github.com/cfengine/cfengine-cli + + - name: Generate changelog + run: | + cd repos/core + cfengine dev generate-changelog + + - name: Run Prettier + uses: creyD/prettier_action@v4.6 + with: + prettier_options: --write repos/core/CHANGELOG.md + only_changed: false + + - name: Create Pull Request + uses: cfengine/create-pull-request@v6 + with: + path: repos/core + branch: changelog/auto-update-changelog-${{ inputs.branch }} + base: ${{ inputs.branch }} + delete-branch: true + title: "docs: update changelog for ${{ inputs.branch }}" + body: | + Auto-generated changelog update. + - **Source branch:** ${{ inputs.branch }} + - **Generated by:** cfengine dev generate-changelog