Skip to content

Conversation

@GABeech
Copy link

@GABeech GABeech commented Jun 15, 2022

This is possible solution to #630 it certainly allows you to override between github instances, but would need some investigation to see if putting a non github host in would work properly.

All this does is simply add an optional input called setHost that will be returned instead of the github urls if defined.

description: Add repository path as safe.directory for Git global config by running `git config --global --add safe.directory <path>`
default: true

setHost:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setHost -> set-host


// Token auth header
const serverUrl = urlHelper.getServerUrl()
const serverUrl = urlHelper.getServerUrl(gitSourceSettings?.setHost)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to

- const serverUrl = urlHelper.getServerUrl()
+ const serverUrl = urlHelper.getServerUrl(this.settings.setHost)
import * as assert from 'assert'
import {IGitSourceSettings} from './git-source-settings'
import {URL} from 'url'
import { settings } from 'cluster'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is useless

@jk2K
Copy link

jk2K commented Jul 29, 2022

input-helper.ts file should be change

  // Set safe.directory in git global config.
  result.setSafeDirectory =
    (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE'

+  // set host
+  result.setHost = (core.getInput('set-host') || '')
+  return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants