Skip to content

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

Merged
itsankit-google merged 1 commit intodevelopfrom
separate-builds
Aug 28, 2024
Merged

[Security Vulnerability] run build with unit tests without elevated permissions#1437
itsankit-google merged 1 commit intodevelopfrom
separate-builds

Conversation

@itsankit-google
Copy link
Copy Markdown
Contributor

@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
@itsankit-google itsankit-google requested a review from tivv August 28, 2024 12:57
- uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_sha }}
Copy link
Copy Markdown

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