From 8cbfffa007e5834bdb5cd8e1c52822fede05bb23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Thu, 14 May 2026 11:17:08 +0200 Subject: [PATCH 1/4] chore: Use custom action to commit changes in CI instead of `git commit` --- .github/workflows/build_archives.yaml | 19 +++++-- .github/workflows/update-templates.yml | 72 ++++++++++++-------------- 2 files changed, 48 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build_archives.yaml b/.github/workflows/build_archives.yaml index 1db9ddd1..048fc153 100644 --- a/.github/workflows/build_archives.yaml +++ b/.github/workflows/build_archives.yaml @@ -28,10 +28,19 @@ jobs: - name: Build template archives run: npm run build - - name: Commit the updated template archives + - name: Stage the updated template archives + id: stage run: | - git config user.name 'GitHub Actions' - git config user.email 'github-actions[bot]@users.noreply.github.com' git add dist/* templates/* - git diff-index --quiet HEAD || git commit -m 'chore: Update template archives [skip ci]' || true - git push + if git diff --cached --quiet; then + echo "has-changes=false" >> "$GITHUB_OUTPUT" + else + echo "has-changes=true" >> "$GITHUB_OUTPUT" + fi + + - name: Commit the updated template archives + if: steps.stage.outputs.has-changes == 'true' + uses: apify/workflows/commit@v0.44.0 + with: + commit-message: 'chore: Update template archives [skip ci]' + github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} diff --git a/.github/workflows/update-templates.yml b/.github/workflows/update-templates.yml index 416f1937..90b38a71 100644 --- a/.github/workflows/update-templates.yml +++ b/.github/workflows/update-templates.yml @@ -43,26 +43,6 @@ jobs: token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} fetch-depth: 0 - - name: Configure Git - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - - name: Check and manage branch - run: | - # Fetch all branches - git fetch origin - - # Check if branch exists on remote - if git ls-remote --heads origin "${{ steps.branch-name.outputs.BRANCH_NAME }}" | grep -q "${{ steps.branch-name.outputs.BRANCH_NAME }}"; then - echo "Branch ${{ steps.branch-name.outputs.BRANCH_NAME }} exists, checking it out and resetting to origin/master" - git checkout "${{ steps.branch-name.outputs.BRANCH_NAME }}" - git reset --hard origin/master - else - echo "Branch ${{ steps.branch-name.outputs.BRANCH_NAME }} does not exist, creating it" - git checkout -b "${{ steps.branch-name.outputs.BRANCH_NAME }}" - fi - - name: Setup Node.js uses: actions/setup-node@v6 with: @@ -75,35 +55,51 @@ jobs: MODULE_VERSION: ${{ env.MODULE_VERSION }} run: node ./scripts/actions/update-templates.mts - - name: Commit and push changes - id: commit-and-push + - name: Stage changes + id: stage + run: | + git add -A + if git diff --cached --quiet; then + echo "has-changes=false" >> "$GITHUB_OUTPUT" + else + echo "has-changes=true" >> "$GITHUB_OUTPUT" + fi + + - name: Reset existing branch + if: steps.stage.outputs.has-changes == 'true' env: GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} run: | BRANCH="${{ steps.branch-name.outputs.BRANCH_NAME }}" - # Check if there are any changes - if git diff --quiet && git diff --cached --quiet; then - echo "No changes to commit" - else - git add -A - git commit -m "chore: Update templates for base image: ${{ env.BASE_IMAGE_RAW }}" - echo "committed=true" >> $GITHUB_OUTPUT - - # Disable auto-merge on any existing PR before force-pushing, - # so the old commit can't be merged while we push the new one. - PR_NUMBER=$(gh pr list --head "$BRANCH" --base master --json number --jq '.[0].number // empty') - if [ -n "$PR_NUMBER" ]; then - gh pr merge "$PR_NUMBER" --disable-auto || true - fi + # If a PR already exists for this branch, disable auto-merge before + # we recreate the branch so the old commit can't be merged. + PR_NUMBER=$(gh pr list --head "$BRANCH" --base master --json number --jq '.[0].number // empty') + if [ -n "$PR_NUMBER" ]; then + gh pr merge "$PR_NUMBER" --disable-auto || true + fi - git push --force origin "$BRANCH" + # Delete the remote branch if it exists. The commit action below + # will recreate it from the current HEAD (which is origin/master). + if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then + echo "Deleting existing remote branch $BRANCH" + git push origin --delete "$BRANCH" fi + - name: Commit and push changes + id: commit-and-push + if: steps.stage.outputs.has-changes == 'true' + uses: apify/workflows/commit@v0.44.0 + with: + commit-message: "chore: Update templates for base image: ${{ env.BASE_IMAGE_RAW }}" + github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} + branch: ${{ steps.branch-name.outputs.BRANCH_NAME }} + create-branch: 'true' + - name: Create or update Pull Request env: GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - if: steps.commit-and-push.outputs.committed == 'true' + if: steps.stage.outputs.has-changes == 'true' run: | BRANCH="${{ steps.branch-name.outputs.BRANCH_NAME }}" From 59dd9c6088034b87bbe152e4bb359e68e33424f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Fri, 15 May 2026 16:47:10 +0200 Subject: [PATCH 2/4] Use `apify/actions/signed-commit`, simplify logic --- .github/workflows/build_archives.yaml | 16 +++------------- .github/workflows/update-templates.yml | 11 +++++------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build_archives.yaml b/.github/workflows/build_archives.yaml index 048fc153..f2fd7164 100644 --- a/.github/workflows/build_archives.yaml +++ b/.github/workflows/build_archives.yaml @@ -28,19 +28,9 @@ jobs: - name: Build template archives run: npm run build - - name: Stage the updated template archives - id: stage - run: | - git add dist/* templates/* - if git diff --cached --quiet; then - echo "has-changes=false" >> "$GITHUB_OUTPUT" - else - echo "has-changes=true" >> "$GITHUB_OUTPUT" - fi - - name: Commit the updated template archives - 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: Update template archives [skip ci]' + message: 'chore: Update template archives [skip ci]' + add: 'dist/* templates/*' github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} diff --git a/.github/workflows/update-templates.yml b/.github/workflows/update-templates.yml index 90b38a71..6fbdd37e 100644 --- a/.github/workflows/update-templates.yml +++ b/.github/workflows/update-templates.yml @@ -55,11 +55,10 @@ jobs: MODULE_VERSION: ${{ env.MODULE_VERSION }} run: node ./scripts/actions/update-templates.mts - - name: Stage changes + - name: Detect changes id: stage run: | - git add -A - if git diff --cached --quiet; then + if git diff --quiet && [ -z "$(git ls-files --others --exclude-standard)" ]; then echo "has-changes=false" >> "$GITHUB_OUTPUT" else echo "has-changes=true" >> "$GITHUB_OUTPUT" @@ -89,9 +88,9 @@ jobs: - name: Commit and push changes id: commit-and-push 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: Update templates for base image: ${{ env.BASE_IMAGE_RAW }}" + message: "chore: Update templates for base image: ${{ env.BASE_IMAGE_RAW }}" github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} branch: ${{ steps.branch-name.outputs.BRANCH_NAME }} create-branch: 'true' @@ -99,7 +98,7 @@ jobs: - name: Create or update Pull Request env: GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - if: steps.stage.outputs.has-changes == 'true' + if: steps.commit-and-push.outputs.committed == 'true' run: | BRANCH="${{ steps.branch-name.outputs.BRANCH_NAME }}" From e1ad8470eac476777ba7e5d7fa20ff36c33f1861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Fri, 15 May 2026 17:13:58 +0200 Subject: [PATCH 3/4] Fix formatting --- .github/workflows/update-templates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-templates.yml b/.github/workflows/update-templates.yml index 6fbdd37e..f2e9afdb 100644 --- a/.github/workflows/update-templates.yml +++ b/.github/workflows/update-templates.yml @@ -90,7 +90,7 @@ jobs: if: steps.stage.outputs.has-changes == 'true' uses: apify/actions/signed-commit@v1.0.0 with: - message: "chore: Update templates for base image: ${{ env.BASE_IMAGE_RAW }}" + message: 'chore: Update templates for base image: ${{ env.BASE_IMAGE_RAW }}' github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} branch: ${{ steps.branch-name.outputs.BRANCH_NAME }} create-branch: 'true' From d1e3b3cbdad26e95c4ad42e2fbdb602366390c75 Mon Sep 17 00:00:00 2001 From: Apify Service Account <64261774+apify-service-account@users.noreply.github.com> Date: Sat, 16 May 2026 20:08:10 +0200 Subject: [PATCH 4/4] chore: Update templates for base image: apify/actor-node --- templates/cli-start/Dockerfile | 2 +- templates/js-bootstrap-cheerio-crawler/Dockerfile | 2 +- templates/js-crawlee-cheerio/Dockerfile | 2 +- templates/js-empty/Dockerfile | 2 +- templates/js-langchain/Dockerfile | 2 +- templates/js-langgraph-agent/Dockerfile | 2 +- templates/js-standby/Dockerfile | 2 +- templates/js-start/Dockerfile | 2 +- templates/ts-beeai-agent/Dockerfile | 4 ++-- templates/ts-bootstrap-cheerio-crawler/Dockerfile | 4 ++-- templates/ts-crawlee-cheerio/Dockerfile | 4 ++-- templates/ts-empty/Dockerfile | 4 ++-- templates/ts-mastraai/Dockerfile | 4 ++-- templates/ts-mcp-empty/Dockerfile | 4 ++-- templates/ts-mcp-proxy/Dockerfile | 4 ++-- templates/ts-standby/Dockerfile | 4 ++-- templates/ts-start/Dockerfile | 4 ++-- 17 files changed, 26 insertions(+), 26 deletions(-) diff --git a/templates/cli-start/Dockerfile b/templates/cli-start/Dockerfile index 5e762ccc..2e7f4d9d 100644 --- a/templates/cli-start/Dockerfile +++ b/templates/cli-start/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Install system dependencies RUN apk add --no-cache jq wget bash curl && \ diff --git a/templates/js-bootstrap-cheerio-crawler/Dockerfile b/templates/js-bootstrap-cheerio-crawler/Dockerfile index 91c9b60b..baee4e6f 100644 --- a/templates/js-bootstrap-cheerio-crawler/Dockerfile +++ b/templates/js-bootstrap-cheerio-crawler/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # See https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/js-crawlee-cheerio/Dockerfile b/templates/js-crawlee-cheerio/Dockerfile index 46a34943..afeb4a4b 100644 --- a/templates/js-crawlee-cheerio/Dockerfile +++ b/templates/js-crawlee-cheerio/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/js-empty/Dockerfile b/templates/js-empty/Dockerfile index 46a34943..afeb4a4b 100644 --- a/templates/js-empty/Dockerfile +++ b/templates/js-empty/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/js-langchain/Dockerfile b/templates/js-langchain/Dockerfile index 3216581b..e7354a12 100644 --- a/templates/js-langchain/Dockerfile +++ b/templates/js-langchain/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/js-langgraph-agent/Dockerfile b/templates/js-langgraph-agent/Dockerfile index 3216581b..e7354a12 100644 --- a/templates/js-langgraph-agent/Dockerfile +++ b/templates/js-langgraph-agent/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/js-standby/Dockerfile b/templates/js-standby/Dockerfile index 46a34943..afeb4a4b 100644 --- a/templates/js-standby/Dockerfile +++ b/templates/js-standby/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/js-start/Dockerfile b/templates/js-start/Dockerfile index 46a34943..afeb4a4b 100644 --- a/templates/js-start/Dockerfile +++ b/templates/js-start/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/ts-beeai-agent/Dockerfile b/templates/ts-beeai-agent/Dockerfile index 8aea3f50..49809ec2 100644 --- a/templates/ts-beeai-agent/Dockerfile +++ b/templates/ts-beeai-agent/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 AS builder +FROM apify/actor-node:22 AS builder # Check preinstalled packages RUN npm ls apify @@ -22,7 +22,7 @@ COPY --chown=myuser:myuser . ./ RUN npm run build # Create final image -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls apify diff --git a/templates/ts-bootstrap-cheerio-crawler/Dockerfile b/templates/ts-bootstrap-cheerio-crawler/Dockerfile index f9e82370..4adc3584 100644 --- a/templates/ts-bootstrap-cheerio-crawler/Dockerfile +++ b/templates/ts-bootstrap-cheerio-crawler/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://crawlee.dev/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 AS builder +FROM apify/actor-node:22 AS builder # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright @@ -22,7 +22,7 @@ COPY --chown=myuser:myuser . ./ RUN npm run build # Create final image -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/ts-crawlee-cheerio/Dockerfile b/templates/ts-crawlee-cheerio/Dockerfile index f9e82370..4adc3584 100644 --- a/templates/ts-crawlee-cheerio/Dockerfile +++ b/templates/ts-crawlee-cheerio/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://crawlee.dev/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 AS builder +FROM apify/actor-node:22 AS builder # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright @@ -22,7 +22,7 @@ COPY --chown=myuser:myuser . ./ RUN npm run build # Create final image -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/ts-empty/Dockerfile b/templates/ts-empty/Dockerfile index b1dc6b22..10f42ba3 100644 --- a/templates/ts-empty/Dockerfile +++ b/templates/ts-empty/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 AS builder +FROM apify/actor-node:22 AS builder # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright @@ -22,7 +22,7 @@ COPY --chown=myuser:myuser . ./ RUN npm run build # Create final image -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/ts-mastraai/Dockerfile b/templates/ts-mastraai/Dockerfile index 81fccf2d..10e8e6cc 100644 --- a/templates/ts-mastraai/Dockerfile +++ b/templates/ts-mastraai/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 AS builder +FROM apify/actor-node:22 AS builder # Copy just package.json and package-lock.json # to speed up the build using Docker layer cache. @@ -19,7 +19,7 @@ COPY --chown=myuser:myuser . ./ RUN npm run build # Create final image -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Copy just package.json and package-lock.json # to speed up the build using Docker layer cache. diff --git a/templates/ts-mcp-empty/Dockerfile b/templates/ts-mcp-empty/Dockerfile index b1dc6b22..10f42ba3 100644 --- a/templates/ts-mcp-empty/Dockerfile +++ b/templates/ts-mcp-empty/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 AS builder +FROM apify/actor-node:22 AS builder # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright @@ -22,7 +22,7 @@ COPY --chown=myuser:myuser . ./ RUN npm run build # Create final image -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/ts-mcp-proxy/Dockerfile b/templates/ts-mcp-proxy/Dockerfile index b1dc6b22..10f42ba3 100644 --- a/templates/ts-mcp-proxy/Dockerfile +++ b/templates/ts-mcp-proxy/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 AS builder +FROM apify/actor-node:22 AS builder # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright @@ -22,7 +22,7 @@ COPY --chown=myuser:myuser . ./ RUN npm run build # Create final image -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/ts-standby/Dockerfile b/templates/ts-standby/Dockerfile index b1dc6b22..10f42ba3 100644 --- a/templates/ts-standby/Dockerfile +++ b/templates/ts-standby/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 AS builder +FROM apify/actor-node:22 AS builder # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright @@ -22,7 +22,7 @@ COPY --chown=myuser:myuser . ./ RUN npm run build # Create final image -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright diff --git a/templates/ts-start/Dockerfile b/templates/ts-start/Dockerfile index b1dc6b22..10f42ba3 100644 --- a/templates/ts-start/Dockerfile +++ b/templates/ts-start/Dockerfile @@ -1,7 +1,7 @@ # Specify the base Docker image. You can read more about # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images # You can also use any other image from Docker Hub. -FROM apify/actor-node:24 AS builder +FROM apify/actor-node:22 AS builder # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright @@ -22,7 +22,7 @@ COPY --chown=myuser:myuser . ./ RUN npm run build # Create final image -FROM apify/actor-node:24 +FROM apify/actor-node:22 # Check preinstalled packages RUN npm ls @crawlee/core apify puppeteer playwright