[Security Vulnerability] run build with unit tests without elevated permissions#1437
Merged
itsankit-google merged 1 commit intodevelopfrom Aug 28, 2024
Merged
[Security Vulnerability] run build with unit tests without elevated permissions#1437itsankit-google merged 1 commit intodevelopfrom
itsankit-google merged 1 commit intodevelopfrom
Conversation
144bd83 to
73e3a79
Compare
tivv
approved these changes
Aug 28, 2024
This was referenced Aug 29, 2024
| - uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94 | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| ref: ${{ github.event.workflow_run.head_sha }} |
There was a problem hiding this comment.
@itsankit-google since this workflow is not trigger on workflow_run anymore, this actions/checkout ref will be blank, probably defaulting to actions/checkout without any ref specified, which with push and pull_request is doing pretty much what you want anyway.... most likely this works, but it's confusing to leave the old reference to workflow_run before the security fix
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.
context:
This change prevents any external contributor to create another workflow in the PR with same name as
Trigger Buildwhich allow it to run theBuild With Unit Testswith elevated permissions.It uses
Github Hosted Runnersto build the surefire report with elevated permissions.Upload/Download Artifact github actions v4 support downloading artifacts from other workflow runs - https://github.com/actions/download-artifact?tab=readme-ov-file#download-artifacts-from-other-workflow-runs-or-repositories