Compare commits

...

19 Commits
v4.1.0 ... main

Author SHA1 Message Date
Michael Schmidt
f4c387e22b removed subpath check
Some checks failed
Build and Test / build (push) Has been cancelled
Build and Test / test (macos-latest) (push) Has been cancelled
Build and Test / test (ubuntu-latest) (push) Has been cancelled
Build and Test / test (windows-latest) (push) Has been cancelled
Build and Test / test-proxy (push) Has been cancelled
Build and Test / test-bypass-proxy (push) Has been cancelled
Build and Test / test-git-container (push) Has been cancelled
Licensed / Check licenses (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Check dist / check-dist (push) Has been cancelled
2023-07-18 07:27:41 +02:00
Michael Schmidt
7b256c6763 checkout@v1.3 2023-07-17 16:11:22 +02:00
Michael Schmidt
c9e55219f5 subpath fix 2023-07-17 16:05:07 +02:00
Michael Schmidt
9eeba4b77e v1.1 2023-07-17 15:45:25 +02:00
Michael Schmidt
9d5d72f348 build v1 2023-07-17 15:35:26 +02:00
Michael Schmidt
1cb683f59c changed the docs 2023-07-13 12:54:34 +02:00
Michael Schmidt
1faf939219 v1.0.1 2023-07-13 11:38:27 +02:00
Michael Schmidt
7e0f95e47a dfghdfghdfrgh 2023-07-11 13:30:41 +02:00
Michael Schmidt
95951da3cb ddddddddddddddddddddddd 2023-07-11 12:33:42 +02:00
Michael Schmidt
bdc764ff89 sdfsdf xcvxcvxcv 2023-07-10 15:42:21 +02:00
Michael Schmidt
be5e352fa7 added pathname to url-helper 2023-07-10 15:37:44 +02:00
Michael Schmidt
016e95b24b hjklhgjgfhjghj 2023-07-10 15:20:02 +02:00
Michael Schmidt
67a3a54916 gdfhdfgh dfghdfgh dfgh 2023-07-10 15:14:11 +02:00
Michael Schmidt
ccbde630fa built index 2023-07-10 14:58:08 +02:00
Michael Schmidt
1d92969ea6 added subdir in url 2023-07-10 14:55:35 +02:00
Michael Schmidt
8098344c6b asdfsadfsadfasdf 2023-07-10 14:51:07 +02:00
Michael Schmidt
ff93395c55 xvcxyvxcyv 2023-07-10 14:47:43 +02:00
Michael Schmidt
f863e5cf3d dcfsdfsdf 2023-07-10 14:28:18 +02:00
Michael Schmidt
7892dca28d build test 2023-07-10 14:19:07 +02:00
8 changed files with 35669 additions and 30563 deletions

17
.gitignore vendored
View File

@@ -2,3 +2,20 @@ __test__/_temp
_temp/ _temp/
lib/ 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

View File

@@ -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> <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> </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. ncc.cmd build .\src\main.ts
When Git 2.18 or higher is not in your PATH, falls back to the REST API to download the files.
# What's new # What's new
- Updated to the node16 runtime by default With this action it is possible to check out a repository located on a Gitea instance with subdirectories.
- 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.
Changed
`https://<domain>[:<port>]/<name>/<repository>`
to
`https://<domain>[:<port>]/<subpath>/<name>/<repository>`
# Usage # Usage
<!-- start usage --> <!-- start usage -->
```yaml ```yaml
- uses: actions/checkout@v3 - uses: https://gitea.com/ScMi1/checkout@v1
with: with:
# Repository name with owner. For example, actions/checkout # Repository name with owner. For example, actions/checkout
# Default: ${{ github.repository }} # Default: ${{ github.repository }}

33327
dist/index.js vendored

File diff suppressed because one or more lines are too long

32849
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -53,7 +53,7 @@ class GitAuthHelper {
// Token auth header // Token auth header
const serverUrl = urlHelper.getServerUrl() 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( const basicCredential = Buffer.from(
`x-access-token:${this.settings.authToken}`, `x-access-token:${this.settings.authToken}`,
'utf8' 'utf8'
@@ -63,7 +63,7 @@ class GitAuthHelper {
this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}` this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`
// Instead of SSH URL // 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}:`) this.insteadOfValues.push(`git@${serverUrl.hostname}:`)
if (this.settings.workflowOrganizationId) { if (this.settings.workflowOrganizationId) {
this.insteadOfValues.push( this.insteadOfValues.push(

View File

@@ -231,6 +231,7 @@ class GitCommandManager {
} }
async init(): Promise<void> { async init(): Promise<void> {
await this.execGit(['config', '--global', 'init.defaultBranch', 'main'])
await this.execGit(['init', this.workingDirectory]) await this.execGit(['init', this.workingDirectory])
} }

View File

@@ -23,15 +23,15 @@ export async function getInputs(): Promise<IGitSourceSettings> {
`${github.context.repo.owner}/${github.context.repo.repo}` `${github.context.repo.owner}/${github.context.repo.repo}`
core.debug(`qualified repository = '${qualifiedRepository}'`) core.debug(`qualified repository = '${qualifiedRepository}'`)
const splitRepository = qualifiedRepository.split('/') const splitRepository = qualifiedRepository.split('/')
if ( // if (
splitRepository.length !== 2 || // splitRepository.length !== 2 ||
!splitRepository[0] || // !splitRepository[0] ||
!splitRepository[1] // !splitRepository[1]
) { // ) {
throw new Error( // throw new Error(
`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.` // `Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`
) // )
} // }
result.repositoryOwner = splitRepository[0] result.repositoryOwner = splitRepository[0]
result.repositoryName = splitRepository[1] result.repositoryName = splitRepository[1]

View File

@@ -16,7 +16,7 @@ export function getFetchUrl(settings: IGitSourceSettings): string {
} }
// "origin" is SCHEME://HOSTNAME[:PORT] // "origin" is SCHEME://HOSTNAME[:PORT]
return `${serviceUrl.origin}/${encodedOwner}/${encodedName}` return `${serviceUrl.origin}${serviceUrl.pathname}/${encodedOwner}/${encodedName}`
} }
export function getServerUrl(): URL { export function getServerUrl(): URL {