Issue

When trying to keep in sync with upstream using the GitHub Action sync-panther-analysis-from-upstream, the following error occurs:

sync-panther-analysis-from-upstream: all jobs have failed

The job stopped working.

Resolution

If you are experiencing an issue while trying to run this over a private mirrored panther-analysis repo, also see this article: Error 'fatal: refusing to merge unrelated histories' when running GitHub action sync-panther-analysis-from-upstream over private mirrored panther-analysis repo

 

To resolve the "all jobs have failed" error:

  1. Clone your organization’s repo.

    • gh repo clone your-org/panther-analysis-copy

  2. Checkout the primary branch.

    • git co master (or main)

  3. Fetch and pull everything from your repo.

    github-action-fetch.png
    • git fetch && git pull

  4. Checkout the sync branch.

    • git checkout sync_upstream_v1.44.0

      • Make sure to replace 1.44.0 with the correct version.

  5. Ensure that you have the upstream panther-analysis as a git remote.

    1. git remote -v

      github-action-remote.png
      • If not, please follow the section below titled "Add upstream panther-analysis as a git remote."

    2. Fetch the upstream.

      • git fetch upstream

    3. Merge in the failing upstream branch to your local sync branch.

      • git merge v1.44.0

        • Make sure to replace 1.44.0 with the correct version.

    4. Resolve the merge conflicts.

      1. Run git status to check your status.

      2. Resolve the merge conflicts:

        1. Take the file from upstream:

          • git checkout --theirs $filename

        2. Keep the local edits and discard upstream’s changes:

          • git checkout --ours $filename

        3. If you need to make other changes: 

          • edit $filename

      3. Add the conflicting file as resolved:

        • git add $filename

 

 

After addressing the files, you can commit the changes:

 

  1. git commit

    github-action-commit.png
  2. Push the resolved merge to your local sync branch

    • git push origin sync_upstream_v1.44.0

      • Make sure to change 1.44.0 to the correct version.

Now you can open a pull request from your local sync branch to your local repo.

Add upstream panther-analysis as a git remote

If you do not have the upstream panther-analysis as a git remote, follow these instructions to add it:

  1. git remote -v

  2. git remote add upstream https://github.com/panther-labs/panther-analysis.git

  3. git remote -v

    github-action-remote2.png

Cause

Merge conflicts and related issues can be occur for a variety of reasons depending on changes that have been made downstream. They typically occur when two separate branches have made edits to the same line in a file, or when a file has been deleted in one branch but edited in the other.