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

Head_ref not found for PR's from forked repositories #694

Open
grzegorzkrukowski opened this issue Feb 12, 2022 · 0 comments
Open

Head_ref not found for PR's from forked repositories #694

grzegorzkrukowski opened this issue Feb 12, 2022 · 0 comments

Comments

@grzegorzkrukowski
Copy link

I am trying to combine checkout with changed-files actions to get list of files that are changed in PR posted to our repository.

Currently I have:

- name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
 - name: Get changed files
      id: changed-files
      uses: tj-actions/changed-files@v14.3

The problem is that sometimes it includes changes coming from master branch into the changed files.

You can see runs here:
Wrong:
https://github.com/raycast/extensions/runs/5148147932?check_suite_focus=true#step:3:107

Right:
https://github.com/raycast/extensions/runs/5149182650?check_suite_focus=true#step:3:107

I tried solution described here:
#27 (comment)

but because my PRs are coming from forked repositories it doesn't work as shown here:
https://github.com/raycast/extensions/actions/runs/1833497844/attempts/1

It doesn't detect sha in case I do ref: ${{ github.head_ref }}.

Is there anything I am miss understanding here ? Is it due to PRs coming from forked repositories ?
Is there a way to make it work properly ?

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

No branches or pull requests

1 participant