From 608ffe274f50da56df5a70de9bee0ff76d41a1a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Thu, 14 May 2026 11:18:58 +0200 Subject: [PATCH 1/2] chore: Use custom action to commit changes in CI instead of `git commit` --- .github/workflows/bump-openapi-version.yaml | 20 ++++++++++++++----- .github/workflows/publish-to-npm.yaml | 22 +++++++++++++++------ 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bump-openapi-version.yaml b/.github/workflows/bump-openapi-version.yaml index ad512e9de5..4c89a223a7 100644 --- a/.github/workflows/bump-openapi-version.yaml +++ b/.github/workflows/bump-openapi-version.yaml @@ -20,11 +20,21 @@ jobs: - name: Bump OpenAPI version run: echo "v2-$(date -u +%Y-%m-%dT%H%M%SZ)" > apify-api/openapi/components/version.yaml + - name: Stage changes + id: stage + run: | + git pull --rebase --autostash + git add -A + if git diff --cached --quiet; then + echo "has-changes=false" >> "$GITHUB_OUTPUT" + else + echo "has-changes=true" >> "$GITHUB_OUTPUT" + fi + - name: Commit changes id: commit - uses: EndBug/add-and-commit@v10 + if: steps.stage.outputs.has-changes == 'true' + uses: apify/workflows/commit@v0.44.0 with: - author_name: github-actions[bot] - author_email: 41898282+github-actions[bot]@users.noreply.github.com - message: "chore(openapi): Update OpenAPI version [skip ci]" - pull: '--rebase --autostash' + commit-message: "chore(openapi): Update OpenAPI version [skip ci]" + github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} diff --git a/.github/workflows/publish-to-npm.yaml b/.github/workflows/publish-to-npm.yaml index 1948fca55b..f2503a1711 100644 --- a/.github/workflows/publish-to-npm.yaml +++ b/.github/workflows/publish-to-npm.yaml @@ -91,15 +91,25 @@ jobs: done; pnpm show "$PACKAGE_NAME@$PACKAGE_VER" # fails if the package is not available, succeeds if it is + - name: Stage the new theme version + id: stage-theme + continue-on-error: true + run: | + git pull --rebase --autostash + git add 'apify-docs-theme/package.json' 'apify-docs-theme/package-lock.json' + if git diff --cached --quiet; then + echo "has-changes=false" >> "$GITHUB_OUTPUT" + else + echo "has-changes=true" >> "$GITHUB_OUTPUT" + fi + - name: Commit the new theme version + if: steps.stage-theme.outputs.has-changes == 'true' continue-on-error: true - uses: EndBug/add-and-commit@v10 + uses: apify/workflows/commit@v0.44.0 with: - add: 'apify-docs-theme/package*.json' - author_name: github-actions[bot] - author_email: 41898282+github-actions[bot]@users.noreply.github.com - message: 'chore: publish new version of @apify/docs-theme [skip ci]' - pull: '--rebase --autostash' + commit-message: 'chore: publish new version of @apify/docs-theme [skip ci]' + github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} rebuild-docs: needs: publish From d4edc75bfc241c8532f41763a3cec5044e90baa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Fri, 15 May 2026 16:47:52 +0200 Subject: [PATCH 2/2] Use `apify/actions/signed-commit`, simplify logic --- .github/workflows/bump-openapi-version.yaml | 17 +++-------------- .github/workflows/publish-to-npm.yaml | 19 ++++--------------- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/.github/workflows/bump-openapi-version.yaml b/.github/workflows/bump-openapi-version.yaml index 4c89a223a7..f7433bbeb8 100644 --- a/.github/workflows/bump-openapi-version.yaml +++ b/.github/workflows/bump-openapi-version.yaml @@ -20,21 +20,10 @@ jobs: - name: Bump OpenAPI version run: echo "v2-$(date -u +%Y-%m-%dT%H%M%SZ)" > apify-api/openapi/components/version.yaml - - name: Stage changes - id: stage - run: | - git pull --rebase --autostash - git add -A - if git diff --cached --quiet; then - echo "has-changes=false" >> "$GITHUB_OUTPUT" - else - echo "has-changes=true" >> "$GITHUB_OUTPUT" - fi - - name: Commit changes id: commit - if: steps.stage.outputs.has-changes == 'true' - uses: apify/workflows/commit@v0.44.0 + uses: apify/actions/signed-commit@v1.0.0 with: - commit-message: "chore(openapi): Update OpenAPI version [skip ci]" + message: "chore(openapi): Update OpenAPI version [skip ci]" + pull: '--rebase --autostash' github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} diff --git a/.github/workflows/publish-to-npm.yaml b/.github/workflows/publish-to-npm.yaml index f2503a1711..7a18cd7ad2 100644 --- a/.github/workflows/publish-to-npm.yaml +++ b/.github/workflows/publish-to-npm.yaml @@ -91,24 +91,13 @@ jobs: done; pnpm show "$PACKAGE_NAME@$PACKAGE_VER" # fails if the package is not available, succeeds if it is - - name: Stage the new theme version - id: stage-theme - continue-on-error: true - run: | - git pull --rebase --autostash - git add 'apify-docs-theme/package.json' 'apify-docs-theme/package-lock.json' - if git diff --cached --quiet; then - echo "has-changes=false" >> "$GITHUB_OUTPUT" - else - echo "has-changes=true" >> "$GITHUB_OUTPUT" - fi - - name: Commit the new theme version - if: steps.stage-theme.outputs.has-changes == 'true' continue-on-error: true - uses: apify/workflows/commit@v0.44.0 + uses: apify/actions/signed-commit@v1.0.0 with: - commit-message: 'chore: publish new version of @apify/docs-theme [skip ci]' + message: 'chore: publish new version of @apify/docs-theme [skip ci]' + add: 'apify-docs-theme/package.json apify-docs-theme/package-lock.json' + pull: '--rebase --autostash' github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} rebuild-docs: