Restrict self-hosted runner job to trusted events only#189
Merged
Conversation
Copilot
AI
changed the title
[WIP] Update GitHub Actions workflow for self-hosted runner security
Restrict self-hosted runner job to trusted events only
Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Any user can open a fork PR and trigger the
real_hardware_test_on_self_hosted_runnerjob, which checks out PR code and runs it on the self-hosted runner — a direct code execution risk on the host machine.Changes
pushtrigger toch55xduinobranch and addworkflow_dispatch;pull_requestremains for hosted-runner jobsif:so it only runs onpushorworkflow_dispatch— never on PR eventspermissions: contents: readat workflow level to minimizeGITHUB_TOKENscopecheck_clangandarduino-cli_compile_allare unaffected and continue to run for all PRs on GitHub-hosted runners.