Skip to content

Commit 40ea735

Browse files
committed
fix: avoid gitleaks false positive on Authorization header
1 parent 03d101a commit 40ea735

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/github-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ jobs:
2323
run: |
2424
$ownerRepo = $env:GITHUB_REPOSITORY
2525
$sha = $env:GITHUB_SHA
26+
$authValue = "token $env:GITHUB_TOKEN"
2627
$headers = @{
27-
Authorization = "token $env:GITHUB_TOKEN"
28+
Authorization = $authValue
2829
Accept = 'application/vnd.github+json'
2930
'X-GitHub-Api-Version' = '2022-11-28'
3031
}
@@ -87,8 +88,9 @@ jobs:
8788
$ownerRepo = $env:GITHUB_REPOSITORY
8889
$versionJson = Get-Content -Raw -Path version.json | ConvertFrom-Json
8990
$tag = "v$($versionJson.major).$($versionJson.minor).$($versionJson.patch)"
91+
$authValue = "token $env:GITHUB_TOKEN"
9092
$headers = @{
91-
Authorization = "token $env:GITHUB_TOKEN"
93+
Authorization = $authValue
9294
Accept = 'application/vnd.github+json'
9395
'X-GitHub-Api-Version' = '2022-11-28'
9496
}

.github/workflows/pypi-publish.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ jobs:
3232
run: |
3333
$ownerRepo = $env:GITHUB_REPOSITORY
3434
$sha = $env:GITHUB_SHA
35+
$authValue = "token $env:GITHUB_TOKEN"
3536
$headers = @{
36-
Authorization = "token $env:GITHUB_TOKEN"
37+
Authorization = $authValue
3738
Accept = 'application/vnd.github+json'
3839
'X-GitHub-Api-Version' = '2022-11-28'
3940
}
@@ -100,8 +101,9 @@ jobs:
100101
run: |
101102
$tag = "${{ github.event.inputs.tag }}"
102103
$ownerRepo = $env:GITHUB_REPOSITORY
104+
$authValue = "token $env:GITHUB_TOKEN"
103105
$headers = @{
104-
Authorization = "token $env:GITHUB_TOKEN"
106+
Authorization = $authValue
105107
Accept = 'application/vnd.github+json'
106108
'X-GitHub-Api-Version' = '2022-11-28'
107109
}
@@ -155,8 +157,9 @@ jobs:
155157
$targetSemVer = [version]$targetVersion
156158
$ownerRepo = $env:GITHUB_REPOSITORY
157159
$packageName = 'moldflow'
160+
$authValue = "token $env:GITHUB_TOKEN"
158161
$headers = @{
159-
Authorization = "token $env:GITHUB_TOKEN"
162+
Authorization = $authValue
160163
Accept = 'application/vnd.github+json'
161164
'X-GitHub-Api-Version' = '2022-11-28'
162165
}
@@ -219,14 +222,15 @@ jobs:
219222
$tag = "${{ github.event.inputs.tag }}"
220223
$version = "${{ steps.validate_tag.outputs.version }}"
221224
$ownerRepo = $env:GITHUB_REPOSITORY
225+
$authValue = "token $env:GITHUB_TOKEN"
222226
$headers = @{
223-
Authorization = "token $env:GITHUB_TOKEN"
227+
Authorization = $authValue
224228
Accept = 'application/octet-stream'
225229
'X-GitHub-Api-Version' = '2022-11-28'
226230
}
227231
228232
$apiHeaders = @{
229-
Authorization = "token $env:GITHUB_TOKEN"
233+
Authorization = $authValue
230234
Accept = 'application/vnd.github+json'
231235
'X-GitHub-Api-Version' = '2022-11-28'
232236
}

0 commit comments

Comments
 (0)