Skip to content

ci: fix brittle docs-theme publish workflow#2303

Merged
barjin merged 3 commits intomasterfrom
copilot/fix-ci-publish-brittleness
Mar 3, 2026
Merged

ci: fix brittle docs-theme publish workflow#2303
barjin merged 3 commits intomasterfrom
copilot/fix-ci-publish-brittleness

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 3, 2026

  • Add concurrency group to queue concurrent workflow runs
  • Read latest version from npm before bumping, with fallback to local package.json
  • Make commit step best-effort (continue-on-error: true)
  • Replace stefanzweifel/git-auto-commit-action with EndBug/add-and-commit@v9 for consistency with other workflows
Original prompt

This section details on the original issue you should resolve

<issue_title>apify-docs-theme CI publish is brittle</issue_title>
<issue_description>The multistep docs-theme publishing setup reads the current version number from the repository, bumps it, and then tries to publish. If the publish succeeds, the new version number is then committed to the repository.

This approach is error-prone as the version number read and write (commit) are not atomic. Another commit to master can happen in the meantime and can overwrite the version number (causing the git commit to fail). Once the git-tracked version number is out of sync w/ npm, the entire workflow breaks.</issue_description>

<agent_instructions>Solve the described issue. Try removing the need for committing the package version to the repository - maybe read the latest version from npm directly before bumping? Also, add exclusive concurrency groups to the theme publishing action. Still commit the version to the repository (best effort basis?), though.

Make minimal changes to achieve this. Use conventional commits for the commit message and PR titles. Do not add excessive comments.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Note

Cursor Bugbot is generating a summary for commit 9bc28e7. Configure here.

Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI publish brittleness for apify-docs-theme ci: fix brittle docs-theme publish workflow Mar 3, 2026
@github-actions github-actions Bot added this to the 135th sprint - Tooling team milestone Mar 3, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Mar 3, 2026
@apify-service-account
Copy link
Copy Markdown

Preview for this PR was built for commit 9bc28e7 and is ready at https://pr-2303.preview.docs.apify.com!

Copy link
Copy Markdown
Member

@barjin barjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (mostly because I prompted this), now I need the second pair of eyes / approve

- name: Bump the theme version
run: |
cd "$GITHUB_WORKSPACE/apify-docs-theme"
npm version patch --legacy-peer-deps
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--legacy-peer-deps indeed doesn't seem to be necessary, tested locally.

@barjin barjin requested a review from janbuchar March 3, 2026 10:56
@barjin barjin marked this pull request as ready for review March 3, 2026 10:56
Comment thread .github/workflows/publish-to-npm.yaml Outdated

- name: Commit the new theme version
continue-on-error: true
uses: stefanzweifel/git-auto-commit-action@v7
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please change this to https://github.com/EndBug/add-and-commit so that it's consistent with the rest of the workflows that we manage?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @copilot you know what to do

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in ac7ff11 - switched to EndBug/add-and-commit@v9 with the same author config as bump-openapi-version.yaml.

Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
commit_author: Apify Bot <apify@apify.com>
add: 'apify-docs-theme/package*.json'
author_name: github-actions[bot]
author_email: 41898282+github-actions[bot]@users.noreply.github.com
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is curious, but we apparently have this in bump-openapi-version.yaml already, so at least we're consistent

@apify-service-account
Copy link
Copy Markdown

Preview for this PR was built for commit ac7ff11 and is ready at https://pr-2303.preview.docs.apify.com!

@barjin barjin merged commit 4b6ecd5 into master Mar 3, 2026
14 checks passed
@barjin barjin deleted the copilot/fix-ci-publish-brittleness branch March 3, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

apify-docs-theme CI publish is brittle

4 participants