Fix issue with trigger_benchmark being too strict with the permission check #6731
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context:
This pull request updates the
trigger_benchmarks
workflow to allow users with write permissions to this repository to trigger benchmarks.Previously, you needed at least
maintain
permissions, which a lot of pennylane development teams did not have.Description of the Change:
The workflow after first verifying that the command issued was
/benchmark
, will hit/repos/OWNER/REPO/collaborators/USERNAME/permission
endpoint for this repo.Then, check if the user object returns has at least
push
permission:If
admin
/maintain
/push
is true, the webhook will be triggered.Benefits:
More people are able to trigger benchmarks.
Possible Drawbacks:
More people are able to trigger benchmarks.
... Ideally we want to have a custom role created, then assign that role to specific teams/users and you would need to have that role in order to trigger benchmark. However, custom roles are only offered on the GitHub Enterprise plan. If we do upgrade to that in the future, we can revisit this logic.
Related GitHub Issues:
None. sc-80243