Skip to content

[CI] post refactor fixes - #297

Open
sarjevane wants to merge 4 commits into
mainfrom
sg/post-ci-refactor-fixes
Open

sarjevane wants to merge 4 commits into
mainfrom
sg/post-ci-refactor-fixes

Conversation

@sarjevane

Copy link
Copy Markdown
Collaborator

Description

  • Make persist-credentials explicit
  • Replace the deprecated actions/create-release with gh release create
  • Split the docs public into build+deploy to avoid running too many commands (e.g. mkdocs) with a write token

Remaining Tasks

Related PRs in other projects (PASQAL developers only)

Additional merge criteria

Breaking changes

Checklist

  • The title of the PR follows the right format: [{Label}] {Short Message}. Label examples: IMPROVEMENT, FIX, REFACTORING... Short message is about what your PR changes.

Versioning (PASQAL developers only)

  • Update the version of pasqal-cloud in VERSION.txt following the changes in your PR and by using semantic versioning.

Documentation

  • Update CHANGELOG.md with a description explaining briefly the changes to the users.

Tests

  • Unit tests have been added or adjusted.
  • Tests were run locally.

Internal tests pipeline (PASQAL developers only)

  • Update and run the internal tests while targeting the branch of this PR.
    If your PR hasn't changed any functionality, it still needs to be validated against internal tests.

After updating the version (PASQAL developers only)

  • Open a PR on the internal tests that updates the version used for the pasqal-cloud backward compatibility tests.

actions/checkout defaults persist-credentials to true, so both of these
jobs were leaving a write-scoped token in .git/config that nothing reads.

- preview.yml (deploy): rossjrw/pr-preview-action authenticates via its
  `token` input, which it forwards to JamesIves/github-pages-deploy-action;
  neither reads .git/config.
- publish-to-testpypi-and-pypi.yml (create-github-release): the job only
  reads VERSION.txt and CHANGELOG.md, and the release step takes its token
  from the environment.

No behaviour change.
actions/create-release was archived in March 2021 and its own README
points users elsewhere. ubuntu-latest ships gh preinstalled, so the
release can be cut directly with no third-party action to pin or trust.

While moving the step:
- pass the notes via --notes-file instead of a GITHUB_ENV heredoc, whose
  EOF delimiter could in principle collide with the changelog text;
- fail loudly when CHANGELOG.md has no section for the tagged version,
  rather than publishing a release with an empty body.

The awk extraction itself is unchanged; verified locally that it still
produces the expected notes for 0.24.0.
publish-doc-to-gh-pages.yml was the last workflow running repository code
next to a contents:write token. `pip install .[docs]` executes packaging
code and mkdocs.yml enables markdown_exec, which runs Python from docs/ at
build time -- previously with a write-scoped credential sitting in
.git/config, because `mkdocs gh-deploy` shells out to `git push` and so
needs persist-credentials to stay on.

Mirror preview.yml instead: an unprivileged build job that only emits an
artifact, and a deploy job that holds the write permission but executes
nothing from the repository. mkdocs gh-deploy is replaced by
JamesIves/github-pages-deploy-action, which authenticates from its `token`
input, so no workflow in the repository persists credentials any more.

This also fixes a standing bug: `mkdocs gh-deploy --force` replaces the
whole gh-pages tree, so every release wiped the pr-preview/ directory that
preview.yml maintains, killing the previews of all open pull requests.
clean-exclude now preserves it.
@sarjevane
sarjevane requested a review from Fenkiou September 9, 2026 19:12
@sarjevane sarjevane self-assigned this Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

🚀 View preview at
https://pasqal-io.github.io/pasqal-cloud/pr-preview/pr-297/

Built to branch gh-pages at 2026-09-09 19:16 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@sarjevane sarjevane mentioned this pull request Sep 9, 2026
7 tasks
} >> "$GITHUB_ENV"

if [ -z "$notes" ]; then
echo "No CHANGELOG.md section found for version '$version'"

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.

Do we really want to make the job fail if nothing in the changelog? I mean the tag is created and package is released to pypi at this point.

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.

Please sync with @thomasbaronnet because he's changing this so we get doc versioning in #294, I'd rather change things there instead of in this PR as this refactor doesn't seem really necessary ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants