Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Vulnerability] run build with unit tests without elevated permissions #1437

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

itsankit-google
Copy link
Member

@itsankit-google itsankit-google commented Aug 28, 2024

context:

This change prevents any external contributor to create another workflow in the PR with same name as Trigger Build which allow it to run the Build With Unit Tests with elevated permissions.

It uses Github Hosted Runners to 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

@itsankit-google itsankit-google added the build Trigger unit test build label Aug 28, 2024

steps:
# Pinned 1.0.0 version
- uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_sha }}

Choose a reason for hiding this comment

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

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Trigger unit test build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants