Skip to content

Having issues creating PR on a server that is not github.com #2020

Closed
@mattinger

Description

@mattinger

My definitions is as follows. The repository was checked out from our enterprise github server (not github.com), so I know there's connectivity.

      - name: commit-and-push-with-pr
        uses: peter-evans/create-pull-request@v5
        if: ${{ inputs.create-pull-request }}
        with:
          token: ${{ steps.set-github-env.outputs.github_token }}
          path: code
          add-paths: "${{ inputs.resource-path }}/**/${{ inputs.localizable-strings-filename }} ${{ inputs.localizable-string-path }}/${{ inputs.localizable-swift-filename}}"
          base: main
          branch: ${{ inputs.commit-branch }}
          commit-message: 'Sync ${{ github.workflow }} strings from S3'
          title: 'CMS Strings update: ${{ github.workflow }}'
          body: 'Sync ${{ github.workflow }} strings from S3'

I've validated that GITHUB_SERVER_URL is correct:

env:
    GITHUB_SERVER_URL: https://github.xxxxx.com/    

Yet when it comes time to push the PR it's failing with this message:

usr/bin/git config --local --get remote.origin.url
  https://github.xxxxx.com/org/repo
  Error: The format of 'https://github.xxxxx.com/org/repo' is not a valid GitHub repository URL

Based on looking at utils.js, it should be picking up the GITHUB_SERVER_URL variable and validating the local git config against that, but for whatever reason it doesn't seem to working correctly.

The same workflow works on github.com repositories, and i can commit using stefanzweifel/git-auto-commit-action@v4 for cases where the user doesn't want a PR created, so it's not a permissions issue.

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