Skip to content

feat: improve releasing with doc-deploy-changelog action - #1568

Merged
moe-ad merged 12 commits into
mainfrom
feat/improve-releasing-with-doc-deploy-changelog
Sep 30, 2026
Merged

moe-ad merged 12 commits into
mainfrom
feat/improve-releasing-with-doc-deploy-changelog

Conversation

@moe-ad

@moe-ad moe-ad commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #626.
This PR updates doc-deploy-pr to be usable in scenarios where users want to prevent multiple workflow runs, such as in #626. I will try to test with a sample project, but this can be reviewed now regardless. At least, I will like to know what people think about the approach before investing further time.

The reasonable approach I could think of is adapting doc-deploy-changelog in way that makes it compatible with single workflow runs, without too much extra configuration by the user. The idea is to have a "same-workflow" switch that controls legacy behavior (i.e. multi-workflow) vs single-workflow behavior. In the later case the action will produce an output containing the release SHA, which the user can then use to setup the remaining release steps.

Summary

A couple of things to keep in mind:

  • Our actions already have the "knobs" needed to make this work, especially the checkout input that is exposed in most.
  • GITHUB_TOKEN behaves such that it will not create a new workflow run when used to push to a PR (see relevant section in the docs). That behavior is also important for making this work.
  • The main limitation of @RobPasMue's suggestion in Bug located in how the Changelog Action interacts with GitHub Environments #626 is that there is no way to have a centralized mechanism to obtain a token that impersonates each user that pushes a tag (at least I can't see how myself, maybe someone might have fresh ideas).

Having said that, these are the changes I made:

  • I have added a same-workflow input to doc-deploy-changelog whose purpose is to simply control whether the action should exit with error or not.
  • If this input is true, the action will produce a release-commit-sha output that will point to the new commit that contains the changes made by the action (i.e. the updated changelog file where all the fragments have been combined).
  • If this input is true, users are expected to have used GITHUB_TOKEN (which will not trigger a re-run) instead of PYANSYS_CI_BOT_TOKEN to ensure the current workflow keeps running. You are probably thinking "but we are already not exiting with error, why is this necessary...", well, remember workflows can still be canceled because of concurrency?
  • Every subsequent job in the release workflow must then be configured to work from release-commit-sha. This is where the checkout input comes in handy. Basically users can do a checkout step before calling an action and pass checkout: false. The will ensure everything runs from the new commit.
  • release-github action has also been updated such that it supports the single-workflow scenario. It now exposes a tag-name input which is passed to the underlying action being called behind the scenes.
  • doc-deploy-stable action also has a new ref input that serves a similar purpose as the above.
  • And to the most important part of the PR, documentation. This is actually the core of the PR, going through it will also help whoever is reviewing the PR understand the approach better.
    • A new release-workflow.rst file has been added that juxtaposes the legacy mode and the single workflow mode.
    • Existing documentation of doc-deploy-changelog action has been updated.

@moe-ad moe-ad self-assigned this Sep 16, 2026
@github-actions github-actions Bot added enhancement General improvements to existing features docs Issues related to documentation labels Sep 16, 2026
@moe-ad moe-ad added the deploy-pr-doc Deploy pull request documentation label Sep 16, 2026
@github-actions

Copy link
Copy Markdown

The documentation for this pull request will be available at https://actions.docs.ansys.com/pull/1568. Please allow some time for the documentation to be deployed.

@moe-ad
moe-ad marked this pull request as ready for review September 16, 2026 16:12
@moe-ad
moe-ad requested a review from a team as a code owner September 16, 2026 16:12

@jorgepiloto jorgepiloto left a comment

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.

Thanks for adding this, Mo. I don't se any blocking issues despite restoring the cheatsheet.

Comment thread doc/source/conf.py Resolved
@jorgepiloto

Copy link
Copy Markdown
Member

Thanks for adding this, Mo. I don't se any blocking issues despite restoring the cheatsheet.

Done in 628ae39

@moe-ad

moe-ad commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for adding this, Mo. I don't se any blocking issues despite restoring the cheatsheet.

My bad. I commented it out to test building the doc locally and forgot to revert. Thanks for restoring.

@RobPasMue RobPasMue left a comment

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.

Works for me although I see it a bit "hacky" not gonna lie... From a developer's expectations... if I am running a workflow for tag "vX.Y.Z" and then the tag gets recreated... but my workflow keeps running pointing to the old tag (but the actions seem to use the new tag/commit)... this seems pretty weird and unexpected.

For me, cancelling the workflow and re-executing is definiteñy more fail-safe and consistent. But if anybody wants to use this.. up to them. I am expecting lots of issues, misconfigurations and debugging sessions for people that enable this.

@moe-ad

moe-ad commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Works for me although I see it a bit "hacky" not gonna lie... From a developer's expectations... if I am running a workflow for tag "vX.Y.Z" and then the tag gets recreated... but my workflow keeps running pointing to the old tag (but the actions seem to use the new tag/commit)... this seems pretty weird and unexpected.

For me, cancelling the workflow and re-executing is definiteñy more fail-safe and consistent. But if anybody wants to use this.. up to them. I am expecting lots of issues, misconfigurations and debugging sessions for people that enable this.

It is a bit hacky, agreed. But as you said, people that choose to use this will be well aware of what to expect. I will also request a review from @da1910 to drop his two cents on what he thinks.

@moe-ad
moe-ad requested a review from da1910 September 21, 2026 10:14
@moe-ad

moe-ad commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Tests

Legacy (i.e. multi-workflow) using this branch + GH environment where "Prevent self-review" is activated.
image

This test confirms two things: what was reported and that the legacy behavior is not impacted by the changes in this PR. So existing users do not have to do anything to their workflows when this is released.

Single workflow approach (i.e. using changes in this branch) + GH environment where "Prevent self-review" is activated
image

As can be seen, all the jobs executed correctly. Most importantly, if you check the v0.9.0 GH release (what was released via single workflow approach), it points to the correct SHA (78b08e1...) on the release branch, and the PR for updating the changelog file on the main branch gets opened as usual.

@SMoraisAnsys

Copy link
Copy Markdown
Contributor

If this PR can wait next week, I'd gladly have a look when I'm back :) Otherwise, I'll see the result afterward :D

@SMoraisAnsys SMoraisAnsys left a comment

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.

LGTM, thanks for the changes !

Comment thread doc-deploy-changelog/action.yml Resolved
@moe-ad
moe-ad merged commit e85710d into main Sep 30, 2026
146 of 170 checks passed
@moe-ad
moe-ad deleted the feat/improve-releasing-with-doc-deploy-changelog branch September 30, 2026 07:16
@github-actions

Copy link
Copy Markdown

This PR has been closed. Documentation for this pull request will shortly be removed from its former deployment address.

moe-ad added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: pyansys-ci-bot <[email protected]>
Co-authored-by: Jorge Martinez <[email protected]>
Co-authored-by: Sébastien Morais <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy-pr-doc Deploy pull request documentation docs Issues related to documentation enhancement General improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug located in how the Changelog Action interacts with GitHub Environments

5 participants