Skip to content

feat: check job permissions and warn if not enough - #1410

Merged
RobPasMue merged 10 commits into
mainfrom
feat/check-permissions
Sep 22, 2026
Merged

RobPasMue merged 10 commits into
mainfrom
feat/check-permissions

Conversation

@inimaz

@inimaz inimaz commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Related to #1391.

  • Goal is to warn if any of the known needed permissions are not there when starting to run the workflow. And if so, add a warning.
  • probe function tests the token against an action in the API that uses the given permission.
  • write permissions not checked for now... Since one has to find a harmless action to run per each permission. We can think of something in future PRs if needed.
  • Adding it to doc-deploy-dev as an example.

@inimaz
inimaz requested a review from a team as a code owner July 10, 2026 11:23
@github-actions github-actions Bot added the enhancement General improvements to existing features label Jul 10, 2026
@moe-ad

moe-ad commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@inimaz can you confirm that this works through some minimal testing?

FYI, to test:

  • Change the _check-github-permissions call on this branch to ansys/actions/_check-github-permissions@feat/check-permissions
  • Call ansys/actions/doc-deploy-dev@feat/check-permissions from a test repo (without enough permissions of course).

@inimaz

inimaz commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author
  • Call ansys/actions/doc-deploy-dev@feat/check-permissions from a test repo (without enough permissions of course).

Nice! I didn't know this was possible, thanks on it!

Comment thread _check-github-permissions/action.yml Resolved
Comment thread _check-github-permissions/action.yml Resolved
Comment thread _check-github-permissions/action.yml Resolved
@inigoimaz inigoimaz self-assigned this Aug 17, 2026

@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, @inigoimaz. Is it something we can expand to other actions?

@inigoimaz

Copy link
Copy Markdown
Contributor

Thanks for adding this, @inigoimaz. Is it something we can expand to other actions?

We can indeed @jorgepiloto ! Shall I do it in a separate PR or in this one? Both approaches are fine by me.

@jorgepiloto

Copy link
Copy Markdown
Member

Thanks for adding this, @inigoimaz. Is it something we can expand to other actions?

We can indeed @jorgepiloto ! Shall I do it in a separate PR or in this one? Both approaches are fine by me.

Let's do it in this same pull-request if that works for you, @inigoimaz

@inigoimaz

inigoimaz commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Let's do it in this same pull-request if that works for you, @inigoimaz

Sounds good @jorgepiloto ! Done here --> c1cae88.

I did not add it to the ones deprecated (e.g. release-pypi-*). I set the branch to feat/check-permissions for now just to see if the ci passes (b1386c8).
Once approved this PR I can change the references back to main before merging.

@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. Approved.

Comment thread _check-github-permissions/action.yml Resolved

@clatapie clatapie 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!

@RobPasMue
RobPasMue force-pushed the feat/check-permissions branch from 10287f3 to 75f2a86 Compare September 22, 2026 07:44
@RobPasMue
RobPasMue merged commit 2ff48d3 into main Sep 22, 2026
39 checks passed
@RobPasMue
RobPasMue deleted the feat/check-permissions branch September 22, 2026 07:45
moe-ad pushed a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Iñigo Imaz <[email protected]>
Co-authored-by: pyansys-ci-bot <[email protected]>
Co-authored-by: Iñigo Imaz <[email protected]>
Co-authored-by: Jorge Martinez <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement General improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants