Skip to content

Commit 86c7a90

Browse files
[Infra] Avoid interpolation for workflow scripts (#6865)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
1 parent 477ddef commit 86c7a90

6 files changed

Lines changed: 30 additions & 13 deletions

File tree

.github/workflows/Component.BuildTest.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ jobs:
5151

5252
runs-on: ${{ matrix.os }}
5353
timeout-minutes: 30
54+
55+
env:
56+
PROJECT_NAME: ${{ inputs.project-name }}
57+
PROJECT_BUILD_COMMANDS: ${{ inputs.project-build-commands }}
58+
TARGET_FRAMEWORK: ${{ matrix.version }}
59+
5460
steps:
5561
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5662
with:
@@ -70,17 +76,20 @@ jobs:
7076
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
7177

7278
- name: dotnet restore ${{ inputs.project-name }}
73-
run: dotnet restore ${{ inputs.project-name }} ${{ inputs.project-build-commands }}
79+
shell: pwsh
80+
run: dotnet restore ${env:PROJECT_NAME} ${env:PROJECT_BUILD_COMMANDS}
7481

7582
- name: dotnet build ${{ inputs.project-name }}
76-
run: dotnet build ${{ inputs.project-name }} --configuration Release --no-restore ${{ inputs.project-build-commands }}
83+
shell: pwsh
84+
run: dotnet build ${env:PROJECT_NAME} --configuration Release --no-restore ${env:PROJECT_BUILD_COMMANDS}
7785

7886
- name: dotnet test ${{ inputs.project-name }}
87+
shell: pwsh
7988
run: >
80-
dotnet test ${{ inputs.project-name }}
89+
dotnet test ${env:PROJECT_NAME}
8190
--collect:"Code Coverage"
8291
--results-directory:TestResults
83-
--framework ${{ matrix.version }}
92+
--framework ${env:TARGET_FRAMEWORK}
8493
--configuration Release
8594
--no-restore
8695
--no-build

.github/workflows/add-labels.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ jobs:
2727
Import-Module .\build\scripts\add-labels.psm1
2828
2929
AddLabelsOnIssuesForPackageFoundInBody `
30-
-issueNumber ${{ github.event.issue.number }} `
30+
-issueNumber ${env:ISSUE_NUMBER} `
3131
-issueBody $env:ISSUE_BODY
3232
env:
3333
GH_TOKEN: ${{ github.token }}
3434
ISSUE_BODY: ${{ github.event.issue.body }}
35+
ISSUE_NUMBER: ${{ github.event.issue.number }}
3536

3637
add-labels-on-pull-requests:
3738
permissions:
@@ -52,7 +53,8 @@ jobs:
5253
Import-Module .\build\scripts\add-labels.psm1
5354
5455
AddLabelsOnPullRequestsBasedOnFilesChanged `
55-
-pullRequestNumber ${{ github.event.pull_request.number }} `
56+
-pullRequestNumber ${env:PR_NUMBER} `
5657
-labelPackagePrefix 'pkg:'
5758
env:
5859
GH_TOKEN: ${{ github.token }}
60+
PR_NUMBER: ${{ github.event.pull_request.number }}

.github/workflows/automation.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ jobs:
3030
outputs:
3131
enabled: ${{ steps.evaluate.outputs.enabled }}
3232

33-
env:
34-
OTELBOT_DOTNET_PRIVATE_KEY_EXISTS: ${{ secrets.OTELBOT_DOTNET_PRIVATE_KEY != '' }}
35-
3633
steps:
3734
- id: evaluate
35+
env:
36+
IS_ENABLED: ${{ secrets.OTELBOT_DOTNET_PRIVATE_KEY != '' }}
3837
run: |
39-
echo "enabled=${{ env.OTELBOT_DOTNET_PRIVATE_KEY_EXISTS == 'true' }}" >> "$GITHUB_OUTPUT"
38+
echo "enabled=$IS_ENABLED" >> "$GITHUB_OUTPUT"

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ jobs:
149149
steps:
150150
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
151151
- name: Run W3C Trace Context docker compose
152-
run: docker compose --file=test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build
152+
run: docker compose --file=test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/docker-compose.yml "--file=build/docker-compose.${FRAMEWORK_VERSION}.yml" --project-directory=. up --exit-code-from=tests --build
153+
env:
154+
FRAMEWORK_VERSION: ${{ matrix.version }}
153155

154156
validate-packages:
155157
needs: detect-changes

.github/workflows/concurrency-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ jobs:
2727

2828
- name: Run Coyote Tests
2929
shell: pwsh
30-
run: .\build\scripts\test-threadSafety.ps1 -testProjectName ${{ matrix.project }} -targetFramework ${{ matrix.version }}
30+
run: .\build\scripts\test-threadSafety.ps1 -testProjectName ${env:PROJECT_NAME} -targetFramework ${env:TARGET_FRAMEWORK}
31+
env:
32+
PROJECT_NAME: ${{ matrix.project }}
33+
TARGET_FRAMEWORK: ${{ matrix.version }}
3134

3235
- name: Publish Artifacts
3336
if: always() && !cancelled()

.github/workflows/verifyaotcompat.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ jobs:
2626

2727
- name: publish AOT testApp, assert static analysis warning count, and run the app
2828
shell: pwsh
29-
run: .\build\scripts\test-aot-compatibility.ps1 ${{ matrix.version }}
29+
run: .\build\scripts\test-aot-compatibility.ps1 ${env:TARGET_FRAMEWORK}
30+
env:
31+
TARGET_FRAMEWORK: ${{ matrix.version }}

0 commit comments

Comments
 (0)