From 49b234aac7fca0b942ad108a5cf39d2325fb68f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Thu, 14 May 2026 11:20:12 +0200 Subject: [PATCH 1/5] chore: Use custom action to commit changes in CI instead of `git commit` --- .github/workflows/node-release.yaml | 49 ++++++++++++++++++++------- .github/workflows/python-release.yaml | 48 ++++++++++++++++++-------- 2 files changed, 70 insertions(+), 27 deletions(-) diff --git a/.github/workflows/node-release.yaml b/.github/workflows/node-release.yaml index 00e79070..f2f862b6 100644 --- a/.github/workflows/node-release.yaml +++ b/.github/workflows/node-release.yaml @@ -28,7 +28,7 @@ jobs: publish: outputs: - bumped-version-commit-sha: ${{ steps.commit.outputs.commit_long_sha || github.sha }} + bumped-version-commit-sha: ${{ steps.commit.outputs.commit-sha || github.sha }} new_version: ${{ steps.get-new-version.outputs.TARGET_VERSION }} defaults: run: @@ -85,15 +85,29 @@ jobs: done exit 1 + - name: Stage changes + working-directory: . + run: | + git pull --rebase --autostash + git add -A + - name: Commit changes id: commit - uses: EndBug/add-and-commit@v10 + uses: apify/workflows/commit@v0.44.0 with: - author_name: Apify Release Bot - author_email: noreply@apify.com - message: "chore(js-release): Update package version [skip ci]" - tag: "js-${{ steps.get-new-version.outputs.TARGET_VERSION }}" - pull: '--rebase --autostash' + commit-message: "chore(js-release): Update package version [skip ci]" + github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} + + - name: Create version tag + working-directory: . + env: + GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} + TAG_NAME: "js-${{ steps.get-new-version.outputs.TARGET_VERSION }}" + COMMIT_SHA: ${{ steps.commit.outputs.commit-sha }} + run: | + gh api -X POST "repos/${GITHUB_REPOSITORY}/git/refs" \ + -f ref="refs/tags/${TAG_NAME}" \ + -f sha="${COMMIT_SHA}" changelog: name: Generate changelog @@ -117,15 +131,24 @@ jobs: OUTPUT: impit-node/CHANGELOG.md GITHUB_REPO: ${{ github.repository }} + - name: Stage new changelog + id: stage_changelog + run: | + git pull --rebase --autostash + git add impit-node/CHANGELOG.md + if git diff --cached --quiet; then + echo "has-changes=false" >> "$GITHUB_OUTPUT" + else + echo "has-changes=true" >> "$GITHUB_OUTPUT" + fi + - name: Commit new changelog id: commit_changelog - uses: EndBug/add-and-commit@v10 + if: steps.stage_changelog.outputs.has-changes == 'true' + uses: apify/workflows/commit@v0.44.0 with: - author_name: github-actions[bot] - author_email: github-actions[bot]@users.noreply.github.com - message: "docs: update changelog [skip ci]" - add: 'impit-node/CHANGELOG.md' - pull: '--rebase --autostash' + commit-message: "docs: update changelog [skip ci]" + github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - name: Create release uses: softprops/action-gh-release@v2 diff --git a/.github/workflows/python-release.yaml b/.github/workflows/python-release.yaml index 93bccac3..d15e7f62 100644 --- a/.github/workflows/python-release.yaml +++ b/.github/workflows/python-release.yaml @@ -19,7 +19,7 @@ jobs: get_version: runs-on: ubuntu-latest outputs: - bumped-version-commit-sha: ${{ steps.commit_version.outputs.commit_long_sha || github.sha }} + bumped-version-commit-sha: ${{ steps.commit_version.outputs.commit-sha || github.sha }} new_version: ${{ steps.increment_version.outputs.new_version }} steps: - uses: actions/checkout@v6 @@ -56,16 +56,27 @@ jobs: echo "New version is ${{ steps.increment_version.outputs.new_version }}" uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version ${{ steps.increment_version.outputs.new_version }} + - name: Stage new version + run: | + git pull --rebase --autostash + git add impit-python/pyproject.toml + - name: Commit new version id: commit_version - uses: EndBug/add-and-commit@v10 + uses: apify/workflows/commit@v0.44.0 with: - author_name: github-actions[bot] - author_email: github-actions[bot]@users.noreply.github.com - message: "chore(py-release): bump `pyproject.toml` version [skip ci]" - add: 'impit-python/pyproject.toml' - tag: "py-${{ steps.increment_version.outputs.new_version }}" - pull: '--rebase --autostash' + commit-message: "chore(py-release): bump `pyproject.toml` version [skip ci]" + github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} + + - name: Create version tag + env: + GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} + TAG_NAME: "py-${{ steps.increment_version.outputs.new_version }}" + COMMIT_SHA: ${{ steps.commit_version.outputs.commit-sha }} + run: | + gh api -X POST "repos/${GITHUB_REPOSITORY}/git/refs" \ + -f ref="refs/tags/${TAG_NAME}" \ + -f sha="${COMMIT_SHA}" test: needs: [get_version] @@ -126,15 +137,24 @@ jobs: OUTPUT: impit-python/CHANGELOG.md GITHUB_REPO: ${{ github.repository }} + - name: Stage new changelog + id: stage_changelog + run: | + git pull --rebase --autostash + git add impit-python/CHANGELOG.md + if git diff --cached --quiet; then + echo "has-changes=false" >> "$GITHUB_OUTPUT" + else + echo "has-changes=true" >> "$GITHUB_OUTPUT" + fi + - name: Commit new changelog id: commit_changelog - uses: EndBug/add-and-commit@v10 + if: steps.stage_changelog.outputs.has-changes == 'true' + uses: apify/workflows/commit@v0.44.0 with: - author_name: github-actions[bot] - author_email: github-actions[bot]@users.noreply.github.com - message: "docs: update changelog [skip ci]" - add: 'impit-python/CHANGELOG.md' - pull: '--rebase --autostash' + commit-message: "docs: update changelog [skip ci]" + github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - name: Create release uses: softprops/action-gh-release@v2 From 9f75b347677729cccdd92f1e747c74ae84fa3f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Fri, 15 May 2026 16:47:47 +0200 Subject: [PATCH 2/5] Use `apify/actions/signed-commit`, simplify logic --- .github/workflows/node-release.yaml | 33 ++++++++------------------- .github/workflows/python-release.yaml | 33 ++++++++------------------- 2 files changed, 19 insertions(+), 47 deletions(-) diff --git a/.github/workflows/node-release.yaml b/.github/workflows/node-release.yaml index f2f862b6..5a5345c0 100644 --- a/.github/workflows/node-release.yaml +++ b/.github/workflows/node-release.yaml @@ -28,7 +28,7 @@ jobs: publish: outputs: - bumped-version-commit-sha: ${{ steps.commit.outputs.commit-sha || github.sha }} + bumped-version-commit-sha: ${{ steps.commit.outputs.commit_sha || github.sha }} new_version: ${{ steps.get-new-version.outputs.TARGET_VERSION }} defaults: run: @@ -85,17 +85,12 @@ jobs: done exit 1 - - name: Stage changes - working-directory: . - run: | - git pull --rebase --autostash - git add -A - - name: Commit changes id: commit - uses: apify/workflows/commit@v0.44.0 + uses: apify/actions/signed-commit@v1.0.0 with: - commit-message: "chore(js-release): Update package version [skip ci]" + message: "chore(js-release): Update package version [skip ci]" + pull: '--rebase --autostash' github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - name: Create version tag @@ -103,7 +98,7 @@ jobs: env: GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} TAG_NAME: "js-${{ steps.get-new-version.outputs.TARGET_VERSION }}" - COMMIT_SHA: ${{ steps.commit.outputs.commit-sha }} + COMMIT_SHA: ${{ steps.commit.outputs.commit_sha }} run: | gh api -X POST "repos/${GITHUB_REPOSITORY}/git/refs" \ -f ref="refs/tags/${TAG_NAME}" \ @@ -131,23 +126,13 @@ jobs: OUTPUT: impit-node/CHANGELOG.md GITHUB_REPO: ${{ github.repository }} - - name: Stage new changelog - id: stage_changelog - run: | - git pull --rebase --autostash - git add impit-node/CHANGELOG.md - if git diff --cached --quiet; then - echo "has-changes=false" >> "$GITHUB_OUTPUT" - else - echo "has-changes=true" >> "$GITHUB_OUTPUT" - fi - - name: Commit new changelog id: commit_changelog - if: steps.stage_changelog.outputs.has-changes == 'true' - uses: apify/workflows/commit@v0.44.0 + uses: apify/actions/signed-commit@v1.0.0 with: - commit-message: "docs: update changelog [skip ci]" + message: "docs: update changelog [skip ci]" + add: impit-node/CHANGELOG.md + pull: '--rebase --autostash' github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - name: Create release diff --git a/.github/workflows/python-release.yaml b/.github/workflows/python-release.yaml index d15e7f62..4add7ecd 100644 --- a/.github/workflows/python-release.yaml +++ b/.github/workflows/python-release.yaml @@ -19,7 +19,7 @@ jobs: get_version: runs-on: ubuntu-latest outputs: - bumped-version-commit-sha: ${{ steps.commit_version.outputs.commit-sha || github.sha }} + bumped-version-commit-sha: ${{ steps.commit_version.outputs.commit_sha || github.sha }} new_version: ${{ steps.increment_version.outputs.new_version }} steps: - uses: actions/checkout@v6 @@ -56,23 +56,20 @@ jobs: echo "New version is ${{ steps.increment_version.outputs.new_version }}" uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version ${{ steps.increment_version.outputs.new_version }} - - name: Stage new version - run: | - git pull --rebase --autostash - git add impit-python/pyproject.toml - - name: Commit new version id: commit_version - uses: apify/workflows/commit@v0.44.0 + uses: apify/actions/signed-commit@v1.0.0 with: - commit-message: "chore(py-release): bump `pyproject.toml` version [skip ci]" + message: "chore(py-release): bump `pyproject.toml` version [skip ci]" + add: impit-python/pyproject.toml + pull: '--rebase --autostash' github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - name: Create version tag env: GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} TAG_NAME: "py-${{ steps.increment_version.outputs.new_version }}" - COMMIT_SHA: ${{ steps.commit_version.outputs.commit-sha }} + COMMIT_SHA: ${{ steps.commit_version.outputs.commit_sha }} run: | gh api -X POST "repos/${GITHUB_REPOSITORY}/git/refs" \ -f ref="refs/tags/${TAG_NAME}" \ @@ -137,23 +134,13 @@ jobs: OUTPUT: impit-python/CHANGELOG.md GITHUB_REPO: ${{ github.repository }} - - name: Stage new changelog - id: stage_changelog - run: | - git pull --rebase --autostash - git add impit-python/CHANGELOG.md - if git diff --cached --quiet; then - echo "has-changes=false" >> "$GITHUB_OUTPUT" - else - echo "has-changes=true" >> "$GITHUB_OUTPUT" - fi - - name: Commit new changelog id: commit_changelog - if: steps.stage_changelog.outputs.has-changes == 'true' - uses: apify/workflows/commit@v0.44.0 + uses: apify/actions/signed-commit@v1.0.0 with: - commit-message: "docs: update changelog [skip ci]" + message: "docs: update changelog [skip ci]" + add: impit-python/CHANGELOG.md + pull: '--rebase --autostash' github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - name: Create release From 96d969f709263ffbff5afcd8ccee818aceddea50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Fri, 15 May 2026 17:04:21 +0200 Subject: [PATCH 3/5] Remove unneeded fallback to `github.sha` --- .github/workflows/python-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-release.yaml b/.github/workflows/python-release.yaml index 4add7ecd..58ed5012 100644 --- a/.github/workflows/python-release.yaml +++ b/.github/workflows/python-release.yaml @@ -19,7 +19,7 @@ jobs: get_version: runs-on: ubuntu-latest outputs: - bumped-version-commit-sha: ${{ steps.commit_version.outputs.commit_sha || github.sha }} + bumped-version-commit-sha: ${{ steps.commit_version.outputs.commit_sha }} new_version: ${{ steps.increment_version.outputs.new_version }} steps: - uses: actions/checkout@v6 @@ -123,7 +123,7 @@ jobs: token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} ref: master fetch-depth: 0 - + - name: Generate a changelog uses: orhun/git-cliff-action@v4 id: git-cliff From f0f9dd7254e2160742fa4dc041f78ff8b8582d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Fri, 15 May 2026 18:36:53 +0200 Subject: [PATCH 4/5] Use long SHA when appropriate --- .github/workflows/node-release.yaml | 4 ++-- .github/workflows/python-release.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node-release.yaml b/.github/workflows/node-release.yaml index 5a5345c0..33d095b6 100644 --- a/.github/workflows/node-release.yaml +++ b/.github/workflows/node-release.yaml @@ -28,7 +28,7 @@ jobs: publish: outputs: - bumped-version-commit-sha: ${{ steps.commit.outputs.commit_sha || github.sha }} + bumped-version-commit-sha: ${{ steps.commit.outputs.commit_long_sha }} new_version: ${{ steps.get-new-version.outputs.TARGET_VERSION }} defaults: run: @@ -98,7 +98,7 @@ jobs: env: GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} TAG_NAME: "js-${{ steps.get-new-version.outputs.TARGET_VERSION }}" - COMMIT_SHA: ${{ steps.commit.outputs.commit_sha }} + COMMIT_SHA: ${{ steps.commit.outputs.commit_long_sha }} run: | gh api -X POST "repos/${GITHUB_REPOSITORY}/git/refs" \ -f ref="refs/tags/${TAG_NAME}" \ diff --git a/.github/workflows/python-release.yaml b/.github/workflows/python-release.yaml index 58ed5012..dd6ca7b7 100644 --- a/.github/workflows/python-release.yaml +++ b/.github/workflows/python-release.yaml @@ -19,7 +19,7 @@ jobs: get_version: runs-on: ubuntu-latest outputs: - bumped-version-commit-sha: ${{ steps.commit_version.outputs.commit_sha }} + bumped-version-commit-sha: ${{ steps.commit_version.outputs.commit_long_sha }} new_version: ${{ steps.increment_version.outputs.new_version }} steps: - uses: actions/checkout@v6 @@ -69,7 +69,7 @@ jobs: env: GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} TAG_NAME: "py-${{ steps.increment_version.outputs.new_version }}" - COMMIT_SHA: ${{ steps.commit_version.outputs.commit_sha }} + COMMIT_SHA: ${{ steps.commit_version.outputs.commit_long_sha }} run: | gh api -X POST "repos/${GITHUB_REPOSITORY}/git/refs" \ -f ref="refs/tags/${TAG_NAME}" \ From f9d801f4581735cff405424e73c5f0a2d416576d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Mon, 18 May 2026 16:41:25 +0200 Subject: [PATCH 5/5] chore: bump apify/actions/signed-commit to v1.1.2 --- .github/workflows/node-release.yaml | 4 ++-- .github/workflows/python-release.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node-release.yaml b/.github/workflows/node-release.yaml index bc4013ef..aa9c6013 100644 --- a/.github/workflows/node-release.yaml +++ b/.github/workflows/node-release.yaml @@ -87,7 +87,7 @@ jobs: - name: Commit changes id: commit - uses: apify/actions/signed-commit@v1.0.0 + uses: apify/actions/signed-commit@v1.1.2 with: message: "chore(js-release): Update package version [skip ci]" pull: '--rebase --autostash' @@ -128,7 +128,7 @@ jobs: - name: Commit new changelog id: commit_changelog - uses: apify/actions/signed-commit@v1.0.0 + uses: apify/actions/signed-commit@v1.1.2 with: message: "docs: update changelog [skip ci]" add: impit-node/CHANGELOG.md diff --git a/.github/workflows/python-release.yaml b/.github/workflows/python-release.yaml index dd6ca7b7..95a058c2 100644 --- a/.github/workflows/python-release.yaml +++ b/.github/workflows/python-release.yaml @@ -58,7 +58,7 @@ jobs: - name: Commit new version id: commit_version - uses: apify/actions/signed-commit@v1.0.0 + uses: apify/actions/signed-commit@v1.1.2 with: message: "chore(py-release): bump `pyproject.toml` version [skip ci]" add: impit-python/pyproject.toml @@ -136,7 +136,7 @@ jobs: - name: Commit new changelog id: commit_changelog - uses: apify/actions/signed-commit@v1.0.0 + uses: apify/actions/signed-commit@v1.1.2 with: message: "docs: update changelog [skip ci]" add: impit-python/CHANGELOG.md