Skip to content

Commit f852eca

Browse files
authored
Merge pull request #321 from microsoftgraph/rsh/scriptWorkflowFix
Script Encoding Fix
2 parents 48f6c24 + 9bf7556 commit f852eca

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ jobs:
3939
shell: pwsh
4040
env:
4141
ENCODED_VALUE: ${{ secrets.LOCAL_PROPERTIES }}
42-
OUTPUT_PATH: .\local.properties
42+
OUTPUT_PATH: '.\local.properties'
4343
- run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
4444
shell: pwsh
4545
env:
4646
ENCODED_VALUE: ${{ secrets.SECRING_GPG }}
47-
OUPUT_PATH: .\secring.gpg
47+
OUPUT_PATH: '.\secring.gpg'
4848
- name: Grant execute permission for gradlew
4949
run: chmod +x gradlew
5050
- name: Publish
@@ -69,12 +69,12 @@ jobs:
6969
shell: pwsh
7070
env:
7171
ENCODED_VALUE: ${{ secrets.LOCAL_PROPERTIES }}
72-
OUTPUT_PATH: .\local.properties
72+
OUTPUT_PATH: '.\local.properties'
7373
- run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
7474
shell: pwsh
7575
env:
7676
ENCODED_VALUE: ${{ secrets.SECRING_GPG }}
77-
OUTPUT_PATH: .\secring.gpg
77+
OUTPUT_PATH: '.\secring.gpg'
7878
- name: Grant execute permission for gradlew
7979
run: chmod +x gradlew
8080
- name: Publish

.github/workflows/gradle-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
java-version: '16'
2929
distribution: 'adopt'
30-
cache: gradle
30+
cache: gradle
3131
- name: Easy detect-secrets
3232
uses: RobertFischer/[email protected]
3333
- name: Grant execute permission for gradlew

scripts/decodeAndWrite.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ if($encodedValue -eq "" -or $null -eq $encodedValue) {
2828
}
2929

3030
$decodedValue = [System.Convert]::FromBase64String($encodedValue)
31-
Set-Content $outputPath -Value $decodedValue -Encoding Byte
31+
$targetFullPath = Join-Path $PWD -ChildPath $outputPath
32+
[System.IO.File]::WriteAllBytes($targetFullPath, $decodedValue)

0 commit comments

Comments
 (0)