Skip to content

Commit f2d0eea

Browse files
Merge pull request #320 from microsoftgraph/dev
Fixed Workflow Conditions
2 parents a4b97f0 + e1172e4 commit f2d0eea

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ env:
2121

2222
jobs:
2323
maven_Preview:
24-
if: ${{ github.ref == 'refs/head/dev' }}
24+
if: ${{ github.ref == 'refs/heads/dev' }}
2525
environment:
2626
name: maven_central_snapshot
2727
runs-on: ubuntu-latest
@@ -39,19 +39,19 @@ 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+
OUTPUT_PATH: '.\secring.gpg'
4848
- name: Grant execute permission for gradlew
4949
run: chmod +x gradlew
5050
- name: Publish
5151
run: ./gradlew $PREVIEW_TASK
5252

5353
maven_Release:
54-
if: ${{ github.ref == 'ref/head/master' }}
54+
if: ${{ github.ref == 'refs/heads/master' }}
5555
environment:
5656
name: maven_central_release
5757
runs-on: ubuntu-latest
@@ -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)