Skip to content

Commit

Permalink
Merge pull request #1091 from arturcic/checkout
Browse files Browse the repository at this point in the history
Checkout
  • Loading branch information
arturcic authored Mar 12, 2024
2 parents a8b14e5 + 16b98d4 commit 274d255
Show file tree
Hide file tree
Showing 20 changed files with 88 additions and 28 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/checkout-path.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: checkout-path
on:
push:
branches:
- checkout

pull_request:
branches:
- checkout
workflow_dispatch:

defaults:
run:
shell: pwsh

jobs:
build:

runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
path: gv-repo
fetch-depth: 0

- name: Install GitVersion
uses: arturcic/gittools-actions/gitversion/setup@checkout
with:
versionSpec: '5.x'
preferLatestVersion: true

- name: Determine version
id: gitversion
uses: arturcic/gittools-actions/gitversion/execute@checkout
with:
targetPath: gv-repo

- run: |
echo "Major (major) : ${{ env.major }}"
echo "Major (env.GitVersion_Major) : ${{ env.GitVersion_Major }}"
echo "Major (steps.gitversion.outputs.major) : ${{ steps.gitversion.outputs.major }}"
echo "Major (steps.gitversion.outputs.GitVersion_Major) : ${{ steps.gitversion.outputs.GitVersion_Major }}"
echo "Minor (minor) : ${{ env.minor }}"
echo "Minor (env.GitVersion_Minor) : ${{ env.GitVersion_Minor }}"
echo "Minor (steps.gitversion.outputs.minor) : ${{ steps.gitversion.outputs.minor }}"
echo "Minor (steps.gitversion.outputs.GitVersion_Minor) : ${{ steps.gitversion.outputs.GitVersion_Minor }}"
echo "Patch (patch) : ${{ env.patch }}"
echo "Patch (env.GitVersion_Patch) : ${{ env.GitVersion_Patch }}"
echo "Patch (steps.gitversion.outputs.patch) : ${{ steps.gitversion.outputs.patch }}"
echo "Patch (steps.gitversion.outputs.GitVersion_Patch) : ${{ steps.gitversion.outputs.GitVersion_Patch }}"
echo "FullSemVer (env.fullSemVer) : ${{ env.fullSemVer }}"
echo "FullSemVer (env.GitVersion_FullSemVer) : ${{ env.GitVersion_FullSemVer }}"
echo "FullSemVer (steps.gitversion.outputs.fullSemVer) : ${{ steps.gitversion.outputs.fullSemVer }}"
echo "FullSemVer (steps.gitversion.outputs.GitVersion_FullSemVer) : ${{ steps.gitversion.outputs.GitVersion_FullSemVer }}"
name: Use variables and output
2 changes: 1 addition & 1 deletion dist/azure/gitreleasemanager/addasset/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/azure/gitreleasemanager/close/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/azure/gitreleasemanager/create/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/azure/gitreleasemanager/discard/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/azure/gitreleasemanager/open/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/azure/gitreleasemanager/publish/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/azure/gitreleasemanager/setup/bundle.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/azure/gitversion/execute/bundle.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/azure/gitversion/setup/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/github/gitreleasemanager/addasset/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/github/gitreleasemanager/close/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/github/gitreleasemanager/create/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/github/gitreleasemanager/discard/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/github/gitreleasemanager/open/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/github/gitreleasemanager/publish/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/github/gitreleasemanager/setup/bundle.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/github/gitversion/execute/bundle.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/github/gitversion/setup/bundle.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/tools/gitversion/tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
}

public async run(options: GitVersionSettings): Promise<IExecResult> {
const isShallowResult = await this.execute('git', ['rev-parse', '--is-shallow-repository'])
const workDir = this.getRepoDir(options)

const isShallowResult = await this.execute('git', ['-C', workDir, 'rev-parse', '--is-shallow-repository'])
if (isShallowResult.code === 0 && isShallowResult.stdout.trim() === 'true') {
throw new Error(
'The repository is shallow. Consider disabling shallow clones. See https://github.com/GitTools/actions/blob/main/docs/cloning.md for more information.'
)
}
const workDir = this.getRepoDir(options)

const args = this.getArguments(workDir, options)

Expand Down

0 comments on commit 274d255

Please sign in to comment.