-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
484 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { run } from './tools/lib.mjs' | ||
await run('azure', 'gitversion', 'command') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"id": "41dc3dd2-6a51-4ba5-a889-824274acca8b", | ||
"name": "gitversion/command", | ||
"friendlyName": "Command GitVersion Task", | ||
"description": "Easy Semantic Versioning (https://semver.org) for projects using Git", | ||
"author": "GitTools Contributors", | ||
"helpMarkDown": "See the [documentation](https://gitversion.net/docs/) for help", | ||
"category": "Build", | ||
"demands": [], | ||
"version": { | ||
"Major": 0, | ||
"Minor": 0, | ||
"Patch": 1 | ||
}, | ||
"minimumAgentVersion": "3.224.0", | ||
"execution": { | ||
"Node20_1": { | ||
"target": "main.mjs", | ||
"argumentFormat": "", | ||
"workingDirectory": "." | ||
} | ||
}, | ||
"instanceNameFormat": "gitversion/command", | ||
"inputs": [ | ||
{ | ||
"name": "targetPath", | ||
"type": "string", | ||
"label": "Working directory path", | ||
"defaultValue": "", | ||
"required": false, | ||
"helpMarkDown": "Optionally supply the path to the working directory", | ||
"groupName": "gitversionDetails" | ||
}, | ||
{ | ||
"name": "disableShallowCloneCheck", | ||
"type": "boolean", | ||
"label": "Disable Shallow Clone Check", | ||
"defaultValue": "false", | ||
"required": false, | ||
"helpMarkDown": "Whether to disable GitVersion shallow clone check" | ||
}, | ||
{ | ||
"name": "arguments", | ||
"type": "string", | ||
"label": "GitVersion arguments", | ||
"defaultValue": "", | ||
"required": true, | ||
"helpMarkDown": "Arguments to send to GitVersion" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Command GitVersion Task (gitversion/command) usage Examples | ||
|
||
Find out how to use the **gitversion/command** task using the examples below. | ||
|
||
Note that if the pipeline is set up to use a shallow git fetch mode the GitVersion Command task will fail. It is required to use `fetchDepth: 0`. | ||
You must also run the GitVersion Setup step before the Command step: | ||
|
||
```yaml | ||
steps: | ||
- checkout: self | ||
fetchDepth: 0 | ||
|
||
- task: gitversion/setup@2.0.1 | ||
displayName: Install GitVersion | ||
inputs: | ||
versionSpec: '6.x' | ||
``` | ||
These steps are omitted from the examples for brevity. | ||
> The examples use version _2.0.1_ of the GitVersion Command task. It is recommended to use the latest released version in your own workflows. | ||
## Inputs | ||
The Command GitVersion task accepts the following inputs: | ||
```yaml | ||
targetPath: | ||
description: Optionally supply the path to the working directory | ||
required: false | ||
default: '' | ||
disableShallowCloneCheck: | ||
description: Whether to disable the check for shallow clone | ||
required: false | ||
default: 'false' | ||
arguments: | ||
description: Arguments to send to GitVersion | ||
required: true | ||
default: '' | ||
``` | ||
--- | ||
## Execution Examples | ||
### Example 1 | ||
<details> | ||
<summary>Show the effective configuration for GitVersion by running the <b>/showConfig</b> command.</summary> | ||
```yaml | ||
steps: | ||
# gitversion/setup@2.0.1 task omitted for brevity. | ||
|
||
- task: gitversion/command@2.0.1 | ||
displayName: Display GitVersion config | ||
inputs: | ||
arguments: '/showConfig' | ||
``` | ||
</details> | ||
### Example 2 | ||
<details> | ||
<summary>Outputs the <i>FullSemVer</i> variable by running the <b>/showvariable FullSemVer</b> command.</summary> | ||
```yaml | ||
steps: | ||
# gitversion/setup@2.0.1 task omitted for brevity. | ||
|
||
- task: gitversion/command@2.0.1 | ||
displayName: Output the FullSemVer variable | ||
inputs: | ||
arguments: '/showvariable FullSemVer' | ||
``` | ||
</details> | ||
### Example 3 | ||
<details> | ||
<summary>Outputs the formatted version by running the <b>/format {Major}.{Minor}</b> command.</summary> | ||
```yaml | ||
steps: | ||
# gitversion/setup@2.0.1 task omitted for brevity. | ||
|
||
- task: gitversion/command@2.0.1 | ||
displayName: Output the formatted version | ||
inputs: | ||
arguments: '/format {Major}.{Minor}' # any Output Variable can be used here | ||
``` | ||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Command GitVersion Action (gitversion/command) usage Examples | ||
|
||
Find out how to use the **gitversion/command** action using the examples below. | ||
|
||
Note that if the pipeline is set up to use a shallow git fetch mode the GitVersion Command action will fail. It is required to use `fetch-depth: 0`. | ||
You must also run the GitVersion Setup step before the Command step: | ||
|
||
```yaml | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/setup@v2.0.1 | ||
with: | ||
versionSpec: '6.x' | ||
``` | ||
These steps are omitted from the examples for brevity. | ||
> The examples use version _2.0.1_ of the GitVersion Command action. It is recommended to use the latest released version in your own workflows. | ||
## Inputs | ||
The Command GitVersion action accepts the following inputs: | ||
```yaml | ||
targetPath: | ||
description: Optionally supply the path to the working directory | ||
required: false | ||
default: '' | ||
disableShallowCloneCheck: | ||
description: Whether to disable the check for shallow clone | ||
required: false | ||
default: 'false' | ||
arguments: | ||
description: Arguments to send to GitVersion | ||
required: true | ||
default: '' | ||
``` | ||
--- | ||
## Execution Examples | ||
### Example 1 | ||
<details> | ||
<summary>Show the effective configuration for GitVersion by running the <b>/showConfig</b> command.</summary> | ||
```yaml | ||
steps: | ||
# gittools/actions/gitversion/setup@v2.0.1 action omitted for brevity. | ||
|
||
- name: Display GitVersion config | ||
uses: gittools/actions/gitversion/command@v2.0.1 | ||
with: | ||
useConfigFile: true | ||
arguments: '/showConfig' | ||
``` | ||
</details> | ||
### Example 2 | ||
<details> | ||
<summary>Outputs the <i>FullSemVer</i> variable by running the <b>/showvariable FullSemVer</b> command.</summary> | ||
```yaml | ||
steps: | ||
# gittools/actions/gitversion/setup@v2.0.1 action omitted for brevity. | ||
|
||
- name: Output the FullSemVer variable | ||
uses: gittools/actions/gitversion/command@v2.0.1 | ||
with: | ||
arguments: '/showvariable FullSemVer' | ||
``` | ||
</details> | ||
### Example 3 | ||
<details> | ||
<summary>Outputs the formatted version by running the <b>/format {Major}.{Minor}</b> command.</summary> | ||
```yaml | ||
steps: | ||
# gittools/actions/gitversion/setup@v2.0.1 action omitted for brevity. | ||
|
||
- name: Output the formatted version | ||
uses: gittools/actions/gitversion/command@v2.0.1 | ||
with: | ||
arguments: '/format {Major}.{Minor}' # any Output Variable can be used here | ||
``` | ||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
BUILD_SOURCESDIRECTORY=. | ||
AGENT_TEMPDIRECTORY=./.test/temp | ||
AGENT_TOOLSDIRECTORY=./.test/tools | ||
GITVERSION_PATH=./.test/tools/GitVersion.Tool/6.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
GITHUB_WORKSPACE=. | ||
RUNNER_TEMP=./.test/temp | ||
RUNNER_TOOL_CACHE=./.test/tools | ||
GITVERSION_PATH=./.test/tools/GitVersion.Tool/6.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
AGENT_SOURCE_DIR=. | ||
AGENT_TEMP_DIR=./.test/temp | ||
AGENT_TOOLS_DIR=./.test/tools | ||
GITVERSION_PATH=./.test/tools/GitVersion.Tool/6.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: gitversion-command | ||
description: GitHub Action for Easy Semantic Versioning with GitVersion. Run GitVersion with arguments. | ||
author: GitTools | ||
branding: | ||
color: gray-dark | ||
icon: git-pull-request | ||
runs: | ||
using: node20 | ||
main: main.mjs | ||
inputs: | ||
targetPath: | ||
description: Optionally supply the path to the working directory | ||
required: false | ||
default: '' | ||
disableShallowCloneCheck: | ||
description: Whether to disable the check for shallow clone | ||
required: false | ||
default: 'false' | ||
arguments: | ||
description: Arguments to send to GitVersion | ||
required: true | ||
default: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { run } from '../../dist/tools/lib.mjs' | ||
await run('github', 'gitversion', 'command') |
Oops, something went wrong.