Github Action cloning parent of fork repository when initiated from child fork

Github action step trying to run a bash script that calculates git diff has default work directory as the remote parent fork repository.

This GitHub Action was initiated from a fork of the mentioned repository.

Screenshot 2021-03-04 at 11.43.14

Can you share the workflow code and describe the setup in more detail? This is too little information to help.

[…] has default work directory as the remote parent fork repository

This sounds like you might use pull_request_target which will checkout the base branch instead of the head branch for security reasons (to prevent arbitrary users to be able to modify your workflow to leak secrets).

I think this answers my question @Simran-B. Thanks for your response.

1 Like

In case you want to learn more about pull_request_target and security:

1 Like