Skip to content

Commit fd2571c

Browse files
authored
Move GitHub PAT to vault (#175)
1 parent 3f04550 commit fd2571c

File tree

2 files changed

+48
-6
lines changed

2 files changed

+48
-6
lines changed

azure-pipelines-gitTests-template.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ parameters:
4141
jobs:
4242
- job: ListRepos
4343
steps:
44+
- task: AzureKeyVault@2
45+
inputs:
46+
azureSubscription: 'TypeScript Public CI'
47+
KeyVaultName: 'jststeam-passwords'
48+
SecretsFilter: 'typescript-bot-github-PAT-error-deltas'
49+
displayName: Get secrets
50+
retryCountOnTaskFailure: 3
4451
- task: UseNode@1
4552
inputs:
4653
version: '20.x'
@@ -52,7 +59,7 @@ jobs:
5259
node dist/listTopRepos ${{ parameters.LANGUAGE }} ${{ parameters.REPO_COUNT }} ${{ parameters.REPO_START_INDEX }} artifacts/repos.json
5360
displayName: 'List top TS repos'
5461
env:
55-
GITHUB_PAT: $(GITHUB_PAT)
62+
GITHUB_PAT: $(typescript-bot-github-PAT-error-deltas)
5663
- publish: artifacts
5764
artifact: RepoList
5865
- job: DetectNewErrors
@@ -62,6 +69,13 @@ jobs:
6269
strategy:
6370
parallel: ${{ parameters.MACHINE_COUNT }}
6471
steps:
72+
- task: AzureKeyVault@2
73+
inputs:
74+
azureSubscription: 'TypeScript Public CI'
75+
KeyVaultName: 'jststeam-passwords'
76+
SecretsFilter: 'typescript-bot-github-PAT-error-deltas'
77+
displayName: Get secrets
78+
retryCountOnTaskFailure: 3
6579
- download: current
6680
artifact: RepoList
6781
- task: UseNode@1
@@ -77,12 +91,19 @@ jobs:
7791
displayName: 'Run TypeScript on repos'
7892
continueOnError: true
7993
env:
80-
GITHUB_PAT: $(GITHUB_PAT)
94+
GITHUB_PAT: $(typescript-bot-github-PAT-error-deltas)
8195
- publish: 'RepoResults$(System.JobPositionInPhase)'
8296
artifact: 'RepoResults$(System.JobPositionInPhase)'
8397
- job: ReportNewErrors
8498
dependsOn: DetectNewErrors
8599
steps:
100+
- task: AzureKeyVault@2
101+
inputs:
102+
azureSubscription: 'TypeScript Public CI'
103+
KeyVaultName: 'jststeam-passwords'
104+
SecretsFilter: 'typescript-bot-github-PAT-error-deltas'
105+
displayName: Get secrets
106+
retryCountOnTaskFailure: 3
86107
- download: current
87108
- task: UseNode@1
88109
inputs:
@@ -94,4 +115,4 @@ jobs:
94115
node dist/postGithubIssue ${{ parameters.ENTRYPOINT }} ${{ parameters.LANGUAGE }} ${{ parameters.REPO_COUNT }} ${{ parameters.REPO_START_INDEX }} '$(Pipeline.Workspace)' '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)' '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)&view=artifacts&type=publishedArtifacts' ${{ parameters.POST_RESULT }} '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/build/builds/$(Build.BuildId)/artifacts'
95116
displayName: 'Create issue from new errors'
96117
env:
97-
GITHUB_PAT: $(GITHUB_PAT)
118+
GITHUB_PAT: $(typescript-bot-github-PAT-error-deltas)

azure-pipelines-userTests.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ variables:
7272
jobs:
7373
- job: ListRepos
7474
steps:
75+
- task: AzureKeyVault@2
76+
inputs:
77+
azureSubscription: 'TypeScript Public CI'
78+
KeyVaultName: 'jststeam-passwords'
79+
SecretsFilter: 'typescript-bot-github-PAT-error-deltas'
80+
displayName: Get secrets
81+
retryCountOnTaskFailure: 3
7582
- task: UseNode@1
7683
inputs:
7784
version: '20.x'
@@ -83,7 +90,7 @@ jobs:
8390
- script: node dist/listTopRepos TypeScript ${{ parameters.REPO_COUNT }} 0 artifacts/repos.json
8491
condition: eq('${{ parameters.TOP_REPOS }}', 'true')
8592
env:
86-
GITHUB_PAT: $(GITHUB_PAT)
93+
GITHUB_PAT: $(typescript-bot-github-PAT-error-deltas)
8794
displayName: 'List top TS repos'
8895
- script: node dist/listUserTestRepos ./userTests artifacts/repos.json
8996
condition: ne('${{ parameters.TOP_REPOS }}', 'true')
@@ -96,6 +103,13 @@ jobs:
96103
strategy:
97104
parallel: ${{ parameters.MACHINE_COUNT }}
98105
steps:
106+
- task: AzureKeyVault@2
107+
inputs:
108+
azureSubscription: 'TypeScript Public CI'
109+
KeyVaultName: 'jststeam-passwords'
110+
SecretsFilter: 'typescript-bot-github-PAT-error-deltas'
111+
displayName: Get secrets
112+
retryCountOnTaskFailure: 3
99113
- download: current
100114
artifact: RepoList
101115
- task: UseNode@1
@@ -110,12 +124,19 @@ jobs:
110124
node dist/checkUserTestRepos ${{ parameters.ENTRYPOINT }} ${{ parameters.OLD_TS_REPO_URL }} ${{ parameters.OLD_HEAD_REF }} ${{ parameters.SOURCE_ISSUE }} ${{ parameters.TOP_REPOS }} '$(Pipeline.Workspace)/RepoList/repos.json' $(System.TotalJobsInPhase) $(System.JobPositionInPhase) 'RepoResults$(System.JobPositionInPhase)' ${{ parameters.DIAGNOSTIC_OUTPUT }} ${{ parameters.PRNG_SEED }}
111125
displayName: 'Run user tests'
112126
env:
113-
GITHUB_PAT: $(GITHUB_PAT)
127+
GITHUB_PAT: $(typescript-bot-github-PAT-error-deltas)
114128
- publish: 'RepoResults$(System.JobPositionInPhase)'
115129
artifact: 'RepoResults$(System.JobPositionInPhase)'
116130
- job: ReportNewErrors
117131
dependsOn: DetectNewErrors
118132
steps:
133+
- task: AzureKeyVault@2
134+
inputs:
135+
azureSubscription: 'TypeScript Public CI'
136+
KeyVaultName: 'jststeam-passwords'
137+
SecretsFilter: 'typescript-bot-github-PAT-error-deltas'
138+
displayName: Get secrets
139+
retryCountOnTaskFailure: 3
119140
- download: current
120141
- task: UseNode@1
121142
inputs:
@@ -127,4 +148,4 @@ jobs:
127148
node dist/postGithubComments ${{ parameters.ENTRYPOINT }} ${{ parameters.REQUESTING_USER }} ${{ parameters.SOURCE_ISSUE }} ${{ parameters.STATUS_COMMENT }} ${{ parameters.DISTINCT_ID }} ${{ parameters.TOP_REPOS }} '$(Pipeline.Workspace)' '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)&view=artifacts&type=publishedArtifacts' ${{ parameters.POST_RESULT }} ${{ parameters.REPO_COUNT }} '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/build/builds/$(Build.BuildId)/artifacts'
128149
displayName: 'Update PR comment with new errors'
129150
env:
130-
GITHUB_PAT: $(GITHUB_PAT)
151+
GITHUB_PAT: $(typescript-bot-github-PAT-error-deltas)

0 commit comments

Comments
 (0)