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

Split github action workflows into two separate workflows #14159

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

krauselukas
Copy link
Contributor

@krauselukas krauselukas commented Apr 13, 2023

In order to allow the creation of comments on PR's that are
coming from forks, we would need to use the :pull_request_target
event over the :pull_request event. Since the :pull_request_target
event comes with more permissions on the target repo, its not recommended to
checkout the code coming from an untrusted fork.
Therefore the gh action workflow is now split into two separate
workflows.
One workflow keeps working on the :pull_request event and checksout
the code to perform the diff operation in order to receive gem
name, version etc. Afterwards the informations are saved as artifacts.
The second workflow listens for the workflow_run event and gets
triggered after the first one finished successfully, then downloads
the artifacts and finally creates the comment (the :workflow_run
event has permission to comment on the PR).

For reference https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

@github-actions github-actions bot added the Test Suite / CI 💉 Things related to our tests/CI label Apr 13, 2023
@krauselukas krauselukas force-pushed the fix/use_pull_request_target branch from 4c2cd0e to eecca7c Compare April 13, 2023 15:32
In order to allow the creation of comments on PR's that are
coming from forks, we would need to use the `:pull_request_target`
event over the `:pull_request` event. Since the `:pull_request_target`
event comes with more permissions on the target repo, its not recommended to
checkout the code coming from an untrusted fork.
Therefore the gh action workflow is now splited into two separate
workflows.
One workflow keeps working on the `:pull_request` event and checksout
the code to perform the diff operation in order to receive gem
name, version etc. Afterwards the informations are saved as artifacts.
The second workflow listens for the `workflow_run` event and gets
triggered after the first one finished successfully, then downloads
the artifacts and finally creates the comment (the `:workflow_run`
event has permission to comment on the PR).
@krauselukas krauselukas force-pushed the fix/use_pull_request_target branch from eecca7c to 359b519 Compare April 13, 2023 15:58
@hennevogel
Copy link
Member

Codecov hangs. Coverage is fine though. See the checks. Merging!

@hennevogel hennevogel merged commit da1ff05 into openSUSE:master Apr 14, 2023
@krauselukas krauselukas deleted the fix/use_pull_request_target branch March 13, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test Suite / CI 💉 Things related to our tests/CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants