Skip to content

Conversation

sprt
Copy link
Contributor

@sprt sprt commented Jun 9, 2025

This removes the ok-to-test label on every push, except if the PR author has write access to the repo (ie. permission to modify labels).

This protects against attackers who would initially open a genuine PR, then push malicious code after the initial review.

Note that this uses pull_request_target so it won't show up in this PR's checks.

@sprt sprt added the ok-to-test label Jun 9, 2025
@sprt sprt requested a review from stevenhorsman June 9, 2025 17:29
This removes the ok-to-test label on every push, except if the PR author
has write access to the repo (ie. permission to modify labels).

This protects against attackers who would initially open a genuine PR,
then push malicious code after the initial review.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
@sprt sprt force-pushed the sprt/validate-ok-to-test branch from adda5ec to 2ee3470 Compare June 9, 2025 17:37
Copy link
Member

@stevenhorsman stevenhorsman left a comment

Choose a reason for hiding this comment

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

This is a great enhancement. Thanks @sprt!

@c3d
Copy link
Member

c3d commented Jun 10, 2025

Looks good to me.

Hmmm… Why do I have a right to close the PR but no longer see the "Review" button? Sorry, can't approve (technically speaking)…

@stevenhorsman
Copy link
Member

Looks good to me.

Hmmm… Why do I have a right to close the PR but no longer see the "Review" button? Sorry, can't approve (technically speaking)…

You have rights to review code - can you try and then we can see if you have a green, or grey tick?

Copy link
Contributor

@zvonkok zvonkok left a comment

Choose a reason for hiding this comment

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

LGTM, great addition

@sprt
Copy link
Contributor Author

sprt commented Jun 10, 2025

Added the ok-to-test label by mistake earlier.

Will force-merge this as a YAML change with 2 approvals.

@sprt sprt merged commit 66ae947 into main Jun 10, 2025
332 of 359 checks passed
@stevenhorsman
Copy link
Member

I've just spotted that there was an actionlint failure on this PR:

.github/workflows/validate-ok-to-test.yml:19:22: receiver of object dereference "owner" must be type of object but got "string" [expression]
   |
19 |           OWNER: ${{ github.repository.owner.login }}

I guess we should make that required once this is fixed?

@stevenhorsman
Copy link
Member

@stevenhorsman stevenhorsman deleted the sprt/validate-ok-to-test branch July 22, 2025 10:43
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.

4 participants