From f5fe675061837427e49b325bb67bafdaf6f3139b Mon Sep 17 00:00:00 2001 From: Daniel Schroeder Date: Sun, 10 Mar 2024 13:14:14 -0600 Subject: [PATCH] docs: Make it clear that the Setup step must be ran before the Execute step Addresses issue #1034 --- .../azure/gitversion/execute/usage-examples.md | 10 +++++++++- docs/examples/azure/gitversion/index.md | 2 ++ .../github/gitversion/execute/usage-examples.md | 10 ++++++++-- docs/examples/github/gitversion/index.md | 2 ++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/examples/azure/gitversion/execute/usage-examples.md b/docs/examples/azure/gitversion/execute/usage-examples.md index 49d59fc51..d10fd2e81 100644 --- a/docs/examples/azure/gitversion/execute/usage-examples.md +++ b/docs/examples/azure/gitversion/execute/usage-examples.md @@ -4,13 +4,21 @@ Find out how to use the **gitversion/execute** task using the examples below. > The examples use the latest _0.x_ version of the GitVersion Execute task. It is recommended to use the latest released version in your own pipelines. -Note that if the pipeline is setup to use a shallow git fetch mode the GitVersion Execute task will fail. It is required to use fetchDepth of 0 like so: +Note that if the pipeline is setup to use a shallow git fetch mode the GitVersion Execute task will fail. It is required to use `fetchDepth: 0`. +You must also run the GitVersion Setup step before the Execute step: ```yaml - checkout: self fetchDepth: 0 + +- task: gitversion/setup@0 + displayName: Install GitVersion + inputs: + versionSpec: '5.x' ``` +These steps are omitted from the examples for brevity. + ## Inputs The Execute GitVersion task accepts the following inputs: diff --git a/docs/examples/azure/gitversion/index.md b/docs/examples/azure/gitversion/index.md index c46e04bfc..f6c039288 100644 --- a/docs/examples/azure/gitversion/index.md +++ b/docs/examples/azure/gitversion/index.md @@ -2,6 +2,8 @@ Use the following links to see usage examples of the Setup GitVersion (**gitversion/setup**) and Execute GitVersion (**gitversion/execute**) tasks. +Note: You need to run the Setup step before the Execute step, otherwise the Execute step will fail with the error `Unable to locate executable file: 'dotnet-gitversion'`. + ## Setup GitVersion (gitversion/setup) - [Usage examples](setup/usage-examples.md) diff --git a/docs/examples/github/gitversion/execute/usage-examples.md b/docs/examples/github/gitversion/execute/usage-examples.md index d4c971fc8..098b41e09 100644 --- a/docs/examples/github/gitversion/execute/usage-examples.md +++ b/docs/examples/github/gitversion/execute/usage-examples.md @@ -2,7 +2,8 @@ Find out how to use the **gitversion/execute** action using the examples below. -For the GitVersion workflow to execute successfully, you must checkout your Git repository with `fetch-depth: 0` to fetch all history for all tags and branches, as follows: +For the GitVersion workflow to execute successfully, you must checkout your Git repository with `fetch-depth: 0` to fetch all history for all tags and branches. +You must also run the GitVersion Setup step before the Execute step: ```yaml steps: @@ -10,9 +11,14 @@ steps: uses: actions/checkout@v2 with: fetch-depth: 0 + + - task: gitversion/setup@0 + displayName: Install GitVersion + inputs: + versionSpec: '5.x' ``` -This step is omitted from the examples for brevity. +These steps are omitted from the examples for brevity. > The examples use version _0.9.7_ of the GitVersion Execute action. It is recommended to use the latest released version in your own workflows. diff --git a/docs/examples/github/gitversion/index.md b/docs/examples/github/gitversion/index.md index 92db39cc8..59c243ec6 100644 --- a/docs/examples/github/gitversion/index.md +++ b/docs/examples/github/gitversion/index.md @@ -2,6 +2,8 @@ Use the following links to see usage examples of the Setup GitVersion (**gitversion/setup**) and Execute GitVersion (**gitversion/execute**) actions. +Note: You need to run the Setup step before the Execute step, otherwise the Execute step will fail with the error `Unable to locate executable file: 'dotnet-gitversion'`. + ## Setup GitVersion (gitversion/setup) - [Usage examples](setup/usage-examples.md)