Skip to content

Commit

Permalink
Update step id naming
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanZosimov committed Dec 20, 2022
1 parent aefe5b4 commit 13abe47
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ jobs:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
id: cp310
id: stepid
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Create temporary global.json
run: echo '{"sdk":{"version": "${{ steps.cp310.outputs.dotnet-version }}"}}' > ./global.json
run: echo '{"sdk":{"version": "${{ steps.stepid.outputs.dotnet-version }}"}}' > ./global.json
- name: Execute dotnet
run: dotnet build <my project>
```
Expand Down Expand Up @@ -178,10 +178,10 @@ In case of a single version installation, the `dotnet-version` output contains t

```yaml
- uses: actions/setup-dotnet@v3
id: cp310
id: stepid
with:
dotnet-version: 3.1.422
- run: echo '${{ steps.cp310.outputs.dotnet-version }}' # outputs 3.1.422
- run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 3.1.422
```

**Multiple version installation**
Expand All @@ -190,26 +190,26 @@ In case of a multiple version installation, the `dotnet-version` output contains

```yaml
- uses: actions/setup-dotnet@v3
id: cp310
id: stepid
with:
dotnet-version: |
3.1.422
5.0.408
- run: echo '${{ steps.cp310.outputs.dotnet-version }}' # outputs 5.0.408
- run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 5.0.408
```
**Installation from global.json**

When the `dotnet-version` input is used along with the `global-json-file` input, the `dotnet-version` output contains the version resolved from the `global.json`.

```yaml
- uses: actions/setup-dotnet@v3
id: cp310
id: stepid
with:
dotnet-version: |
3.1.422
5.0.408
global-json-file: "./global.json" # contains version 2.2.207
- run: echo '${{ steps.cp310.outputs.dotnet-version }}' # outputs 2.2.207
- run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 2.2.207
```

## Environment variables
Expand Down

0 comments on commit 13abe47

Please sign in to comment.