From d1880f6e7fdc807c3012fd162a9bc9d21a439e70 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Mon, 13 Jan 2025 16:03:58 +0000 Subject: [PATCH 1/2] Added workflow to autopopulate changelogs --- .github/workflows/antsibull-release.yml | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/antsibull-release.yml diff --git a/.github/workflows/antsibull-release.yml b/.github/workflows/antsibull-release.yml new file mode 100644 index 0000000..16e936d --- /dev/null +++ b/.github/workflows/antsibull-release.yml @@ -0,0 +1,35 @@ +--- +name: Update Antsibull changelogs for Ansible collection +on: + workflow_call: + inputs: + galaxy_directory: + type: string + default: "." + description: Directory containing galaxy.yml, CHANGELOG.rst and the changelogs subdirectory + +jobs: + check-and-update: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Check for galaxy version bumps + id: check_galaxy + run: | + set +e + git diff --unified=0 HEAD^1 HEAD ${{ inputs.galaxy_directory }}/galaxy.yml | grep -v "^@" | grep version + VERSION_CHANGED=$? + set -e + echo "version_changed=$VERSION_CHANGED" >> "$GITHUB_OUTPUT" + + - name: Create and push release with Antsibull + if: ${{ steps.check_galaxy.outputs.version_changed == '0' }} + run: | + pip install antsibull-changelog==0.31.1 + antsibull-changelog release + git add CHANGELOG.rst changelogs + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + git commit -m "Updated changelogs" + git push From b0be0468a828c889e8d734561844cb1db95023f3 Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:35:10 +0000 Subject: [PATCH 2/2] now fetches head^1 --- .github/workflows/antsibull-release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/antsibull-release.yml b/.github/workflows/antsibull-release.yml index 16e936d..788aa74 100644 --- a/.github/workflows/antsibull-release.yml +++ b/.github/workflows/antsibull-release.yml @@ -13,6 +13,8 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + with: + fetch-depth: 2 - name: Check for galaxy version bumps id: check_galaxy