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

Checking out a public repo from another repo fails (##[error]The process '/usr/bin/git' failed with exit code 1) #1962

Closed
autumoswitzerland opened this issue Oct 28, 2024 · 1 comment

Comments

@autumoswitzerland
Copy link

autumoswitzerland commented Oct 28, 2024

Situation

I have a private repo in which several packages are created, which are then to be published in a public repo. A token was set up in the Github account via “Settings->Developer settings->Personal access tokens (classic)”. This token was then added to the private repo via “Settings->Secrets and variables->Actions” as a repo secret with the name “PAT_TOKEN”.
The workflow of the private repo must check out the public repo, then the artifacts created in the private repo are downloaded to the checked out public repo and finally the downloaded artifacts are committed to the public repo.

Problem

The checkout fails, but the connection appears to be established successfully. Also, 2 retries are made until the process fails.

The error message “##[error]The process '/usr/bin/git' failed with exit code 1” is pretty trivial and doesn't say much, even though I have “GIT_TRACE” and “GIT_CURL_VERBOSE” enabled.

This is the release-snippet:

...
release:
    runs-on: ubuntu-latest
    if: ${{ needs.build.outputs.APP_VERSION == '2.1.0' }}
    needs: build
    steps:
      - name: Checkout public repo
        uses: actions/checkout@v4
        with:
          fetch-depth: 1
          lfs: false
          ref: master
          repository: autumoswitzerland/autumo-ifacex-studio-public
          token: ${{ secrets.PAT_TOKEN }}
        env:
          GIT_TRACE: true
          GIT_CURL_VERBOSE: true
          
      - name: Download all artifacts
        uses: actions/download-artifact@v4
        with:
          path: .
          if-no-files-found: error

      - name: Create Release
        uses: softprops/action-gh-release@v2
        with:
          tag: v${{ needs.build.outputs.APP_VERSION }}
          release_name: "ifaceX Studio ${{ needs.build.outputs.APP_VERSION }}"
          body: "ifaceX Studio Installers for Windows, macOS, and Linux."
          draft: true
          prerelease: false          
        env:
          GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
              
      - name: Commit and push changes
        run: |
          git config --local user.name "autumo GmbH"
          git config --local user.email "email.address@domain.com"
          git add .
          git commit -m "ifaceX Studio ${{ needs.build.outputs.APP_VERSION }} Native Installers Release."
          git push

Additional infos:

  • I have also tried to play with the parameters “lfs” and “fetch-depth”, without success.
  • To clarify: the workflow is executed on github.com, not locally.

Attached files:

@autumoswitzerland
Copy link
Author

I found the error next to some incorrectly named fields that lead to warnings:

The “ref” in “Checkout public repo” leads to this error. It seems that no branch needs to be specified here.

Remove: ref: master

Closing the issue.

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