Skip to content

Github Enterprise Compatibility  #579

@ghost

Description

I can not find an option (a clean one) that allows to set the Server URL or Api Url and they seem to be hardcoded to github.com.

Prepare publishing assets
  [INFO] ForceOrphan: false
  /usr/bin/git clone --depth=1 --single-branch --branch gh-pages ***github.com/coresystemsFSM/blog.git /home/runners/actions_github_pages_1615224725805
  Cloning into '/home/runners/actions_github_pages_1615224725805'...
  remote: Invalid username or password.
  fatal: Authentication failed for 'https://github.com/coresystemsFSM/blog.git/'

This fails because our repo is at https://github.tools.sap/coresystemsFSM/blog

As we want to use your action with GitHub Enterprise we would need to be able to customise those.

Link to your contents

I see one entry here but I think its unused during a workflow.

ENV GITHUB_SERVER_URL="https://github.com"

Additional context

I would contribute a PR if you give me 1-2 pointers where I'd need to add things in your structure.

Activity

ghost added on Mar 8, 2021
ghost changed the title [-]sample_title[/-] [+]Github Enterprise Compatibility [/+] on Mar 8, 2021
peaceiris

peaceiris commented on Mar 8, 2021

@peaceiris
Owner

Since I have no environment of GitHub Enterprise Server, I was looking forward to this issue, thanks!

export function setGithubToken(

We can modify the function setGithubToken to get a server domain from process.env['GITHUB_SERVER_URL'].

peaceiris

peaceiris commented on Mar 8, 2021

@peaceiris
Owner

Those are also helpful for us.

export function getServerUrl(): URL {
  // todo: remove GITHUB_URL after support for GHES Alpha is no longer needed
  return new URL(
    process.env['GITHUB_SERVER_URL'] ||
      process.env['GITHUB_URL'] ||
      'https://github.com'
  )
}
const serverUrl = getServerUrl()

return `https://x-access-token:${githubToken}@${serverUrl.hostname}/${publishRepo}.git`;
mambax

mambax commented on Mar 8, 2021

@mambax
Contributor

Should we read the ENV variable or should it be handed into the action by an input?
I can PR both, what is the better design - I am a novice!?

peaceiris

peaceiris commented on Mar 8, 2021

@peaceiris
Owner

The former is the best because GITHUB_SERVER_URL can provide a URL of a company's GitHub Enterprise Server.

mambax

mambax commented on Mar 9, 2021

@mambax
Contributor

The former is the best because GITHUB_SERVER_URL can provide a URL of a company's GitHub Enterprise Server.

On it, expect PR 🔄

added a commit that references this issue on Mar 9, 2021

11 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @thiagocrepaldi@mambax@jiminj@peaceiris

    Issue actions

      Github Enterprise Compatibility · Issue #579 · peaceiris/actions-gh-pages