You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug located in how the Changelog Action interacts with GitHub Environments #626
Our setup for publishing with the trusted publisher workflow leverages environments to secure access to publishing new versions of packages. The intended workflow for environments with approvals is that the person triggering the workflow is not able to approve their own request.
The doc deploy changelog workflow circumvents this security by triggering a follow up workflow run as the pyansys bot, this means a user is then able to approve their own publish. This may be acceptable or it may not, but ideally the follow up run would be triggered as the same user who initially pushed the tag.
📝 Steps to reproduce
Publish a tag on a repository that has trusted publisher enabled with an environment
Aha interesting. This would imply that the tag and changelog no longer get committed by the CI bot account, but by whomever initiated the release.
[Line of thought.... you can skip reading this]
We should check whether passing the ``${{ github.actor }} and GITHUB_TOKEN approach works. However, I believe it would also imply that we need to grant our workflow file write permissions for creating tags, otherwise the usage of the GITHUB_TOKEN would cause a failure... Lastly, the email is not available through the context... https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context so... this might be an issue (I guess?). However, if you are checking the repo out as "user A" in the workflow, GitHub should have configured everything under "user A" ... which means that we won't need any of the above since it's already configured.. we just need to commit and create the tag (assuming the workflow has permissions to create tags - i.e. write permissions).
This requires testing but I think it might be a good idea @klmcadams
Activity
RobPasMue commentedon Oct 28, 2024
Aha interesting. This would imply that the tag and changelog no longer get committed by the CI bot account, but by whomever initiated the release.
[Line of thought.... you can skip reading this]
We should check whether passing the ``${{ github.actor }} and GITHUB_TOKEN approach works. However, I believe it would also imply that we need to grant our workflow file write permissions for creating tags, otherwise the usage of the GITHUB_TOKEN would cause a failure... Lastly, the email is not available through the context... https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context so... this might be an issue (I guess?). However, if you are checking the repo out as "user A" in the workflow, GitHub should have configured everything under "user A" ... which means that we won't need any of the above since it's already configured.. we just need to commit and create the tag (assuming the workflow has permissions to create tags - i.e. write permissions).
This requires testing but I think it might be a good idea @klmcadams