Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9e55219f5 | ||
|
|
9eeba4b77e | ||
|
|
9d5d72f348 | ||
|
|
1cb683f59c | ||
|
|
1faf939219 | ||
|
|
7e0f95e47a | ||
|
|
95951da3cb | ||
|
|
bdc764ff89 | ||
|
|
be5e352fa7 | ||
|
|
016e95b24b | ||
|
|
67a3a54916 | ||
|
|
ccbde630fa | ||
|
|
1d92969ea6 | ||
|
|
8098344c6b | ||
|
|
ff93395c55 | ||
|
|
f863e5cf3d | ||
|
|
7892dca28d |
19
.gitignore
vendored
19
.gitignore
vendored
@@ -1,4 +1,21 @@
|
||||
__test__/_temp
|
||||
_temp/
|
||||
lib/
|
||||
node_modules/
|
||||
node_modules/
|
||||
/dist/fs-helper.d.ts
|
||||
/dist/git-auth-helper.d.ts
|
||||
/dist/git-command-manager.d.ts
|
||||
/dist/git-directory-helper.d.ts
|
||||
/dist/git-source-provider.d.ts
|
||||
/dist/git-source-settings.d.ts
|
||||
/dist/git-version.d.ts
|
||||
/dist/github-api-helper.d.ts
|
||||
/dist/input-helper.d.ts
|
||||
/dist/main.d.ts
|
||||
/dist/misc/generate-docs.d.ts
|
||||
/dist/ref-helper.d.ts
|
||||
/dist/regexp-helper.d.ts
|
||||
/dist/retry-helper.d.ts
|
||||
/dist/state-helper.d.ts
|
||||
/dist/url-helper.d.ts
|
||||
/dist/workflow-context-helper.d.ts
|
||||
|
||||
20
README.md
20
README.md
@@ -2,26 +2,28 @@
|
||||
<a href="https://github.com/actions/checkout"><img alt="GitHub Actions status" src="https://github.com/actions/checkout/workflows/test-local/badge.svg"></a>
|
||||
</p>
|
||||
|
||||
# Checkout V3
|
||||
This is a fork of https://github.com/actions/checkout@v3
|
||||
|
||||
This action checks-out your repository under `$GITHUB_WORKSPACE`, so your workflow can access it.
|
||||
# Build
|
||||
|
||||
Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. Set `fetch-depth: 0` to fetch all history for all branches and tags. Refer [here](https://help.github.com/en/articles/events-that-trigger-workflows) to learn which commit `$GITHUB_SHA` points to for different events.
|
||||
## Windows
|
||||
|
||||
The auth token is persisted in the local git config. This enables your scripts to run authenticated git commands. The token is removed during post-job cleanup. Set `persist-credentials: false` to opt-out.
|
||||
|
||||
When Git 2.18 or higher is not in your PATH, falls back to the REST API to download the files.
|
||||
ncc.cmd build .\src\main.ts
|
||||
|
||||
# What's new
|
||||
|
||||
- Updated to the node16 runtime by default
|
||||
- This requires a minimum [Actions Runner](https://github.com/actions/runner/releases/tag/v2.285.0) version of v2.285.0 to run, which is by default available in GHES 3.4 or later.
|
||||
With this action it is possible to check out a repository located on a Gitea instance with subdirectories.
|
||||
|
||||
Changed
|
||||
`https://<domain>[:<port>]/<name>/<repository>`
|
||||
to
|
||||
`https://<domain>[:<port>]/<subpath>/<name>/<repository>`
|
||||
|
||||
# Usage
|
||||
|
||||
<!-- start usage -->
|
||||
```yaml
|
||||
- uses: actions/checkout@v3
|
||||
- uses: https://gitea.com/ScMi1/checkout@v1
|
||||
with:
|
||||
# Repository name with owner. For example, actions/checkout
|
||||
# Default: ${{ github.repository }}
|
||||
|
||||
33318
dist/index.js
vendored
33318
dist/index.js
vendored
File diff suppressed because one or more lines are too long
32849
package-lock.json
generated
32849
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -53,7 +53,7 @@ class GitAuthHelper {
|
||||
|
||||
// Token auth header
|
||||
const serverUrl = urlHelper.getServerUrl()
|
||||
this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader` // "origin" is SCHEME://HOSTNAME[:PORT]
|
||||
this.tokenConfigKey = `http.${serverUrl.origin}${serverUrl.pathname}/.extraheader` // "origin" is SCHEME://HOSTNAME[:PORT]
|
||||
const basicCredential = Buffer.from(
|
||||
`x-access-token:${this.settings.authToken}`,
|
||||
'utf8'
|
||||
@@ -63,7 +63,7 @@ class GitAuthHelper {
|
||||
this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`
|
||||
|
||||
// Instead of SSH URL
|
||||
this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf` // "origin" is SCHEME://HOSTNAME[:PORT]
|
||||
this.insteadOfKey = `url.${serverUrl.origin}${serverUrl.pathname}/.insteadOf` // "origin" is SCHEME://HOSTNAME[:PORT]
|
||||
this.insteadOfValues.push(`git@${serverUrl.hostname}:`)
|
||||
if (this.settings.workflowOrganizationId) {
|
||||
this.insteadOfValues.push(
|
||||
|
||||
@@ -231,6 +231,7 @@ class GitCommandManager {
|
||||
}
|
||||
|
||||
async init(): Promise<void> {
|
||||
await this.execGit(['config', '--global', 'init.defaultBranch', 'main'])
|
||||
await this.execGit(['init', this.workingDirectory])
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,10 @@ export async function getInputs(): Promise<IGitSourceSettings> {
|
||||
`${github.context.repo.owner}/${github.context.repo.repo}`
|
||||
core.debug(`qualified repository = '${qualifiedRepository}'`)
|
||||
const splitRepository = qualifiedRepository.split('/')
|
||||
if(splitRepository.length === 3) {
|
||||
splitRepository.shift()
|
||||
}
|
||||
|
||||
if (
|
||||
splitRepository.length !== 2 ||
|
||||
!splitRepository[0] ||
|
||||
|
||||
@@ -16,7 +16,7 @@ export function getFetchUrl(settings: IGitSourceSettings): string {
|
||||
}
|
||||
|
||||
// "origin" is SCHEME://HOSTNAME[:PORT]
|
||||
return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`
|
||||
return `${serviceUrl.origin}${serviceUrl.pathname}/${encodedOwner}/${encodedName}`
|
||||
}
|
||||
|
||||
export function getServerUrl(): URL {
|
||||
|
||||
Reference in New Issue
Block a user