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

Pull Requests from outside contributors do not get the correct ref #83

Closed
cellistigs opened this issue Aug 2, 2021 · 1 comment
Closed

Comments

@cellistigs
Copy link
Collaborator

Pull Requests from forks/outside contributors (not sure which) don't trigger the right pull in get_pull_request_ref action. In particular, look at the code here:

deploy:
    runs-on: ubuntu-latest
    needs: deploy-check
    if: needs.deploy-check.outputs.triggered == 'true'
    steps:
      - name: get pull request ref
        id: get_pull_request_ref
        uses: octokit/[email protected]
        with:
          route: GET /repos/{owner}/{repo}/pulls/{issue_id}
          owner: cunningham-lab
          repo: neurocaas
          repository: ${{ github.repository }}
          issue_id: ${{ github.event.issue.number }}
        env:
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

Later, we explicitly call fromJson(steps.get_pull_request_ref.outputs.data).head.ref as the output of this step, which will just get the ref for master. We need to find a way to reference the ref of the forking repo.

Play around with the first solution suggested here:
actions/checkout#455

this might be useful:
https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/

@cellistigs
Copy link
Collaborator Author

Fixed. The solution was to get the head.sha attribute instead of the head.ref attribute.

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