Skip to content

Compatability with forks #385

@neuronull

Description

@neuronull

We're using this helpful GHA in CI at https://github.com/vectordotdev/vector/

One limitation we've ran into is that the when we trigger a workflow run that uses this GHA, but the PR was opened from a fork off the main repo, the git fetch operation fails.

Presumably this is because the GHA is looking at the main repo for the branch in question.

Example output:

Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/readd-log-to-metric-feat*:refs/remotes/origin/readd-log-to-metric-feat* +refs/tags/readd-log-to-metric-feat*:refs/tags/readd-log-to-metric-feat*
  The process '/usr/bin/git' failed with exit code 1
  Waiting 11 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/readd-log-to-metric-feat*:refs/remotes/origin/readd-log-to-metric-feat* +refs/tags/readd-log-to-metric-feat*:refs/tags/readd-log-to-metric-feat*
  The process '/usr/bin/git' failed with exit code 1
  Waiting 13 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/readd-log-to-metric-feat*:refs/remotes/origin/readd-log-to-metric-feat* +refs/tags/readd-log-to-metric-feat*:refs/tags/readd-log-to-metric-feat*
  Error: The process '/usr/bin/git' failed with exit code 1

It would be very useful to be able to use this GHA with PRs that are opened from forks! Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions