Skip to content

Commit 3163d4e

Browse files
committed
projen github token
1 parent 0a86b99 commit 3163d4e

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.github/workflows/issue-label-assign.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projenrc/issue-labeler.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ const AREA_PARAMS = [
1313
{ area: 'cdk-assets', keywords: ['assets', 'cdk-assets'], labels: ['cdk-assets'] },
1414
];
1515

16+
enum GitHubToken {
17+
GITHUB_TOKEN = 'secrets.GITHUB_TOKEN',
18+
PROJEN_GITHUB_TOKEN = 'secrets.PROJEN_GITHUB_TOKEN',
19+
}
20+
1621
/**
1722
* See https://github.com/aws-github-ops/aws-issue-triage-manager
1823
*/
@@ -25,7 +30,15 @@ interface TriageManagerOptions {
2530
parameters?: string;
2631
affixes?: string;
2732
areaIsKeyword?: boolean;
33+
/**
34+
* Whether or not the env variables are needed for the job.
35+
* Workflow-level env variables are not configurable via Projen
36+
*/
2837
needEnvs?: boolean;
38+
/**
39+
* @default GitHubToken.GITHUB_TOKEN
40+
*/
41+
githubToken?: GitHubToken;
2942
}
3043

3144
function stringifyList(list: string[]) {
@@ -42,7 +55,7 @@ function triageManagerJob(triageManagerOptions: TriageManagerOptions) {
4255
name: 'Triage Manager',
4356
uses: 'aws-github-ops/aws-issue-triage-manager@main',
4457
with: {
45-
'github-token': "${{ secrets.GITHUB_TOKEN }}",
58+
'github-token': `\${{ ${triageManagerOptions.githubToken ?? 'secrets.GITHUB_TOKEN'} }}`,
4659
target: triageManagerOptions.target,
4760
'excluded-expressions': triageManagerOptions.excludedExpressions ? stringifyList(triageManagerOptions.excludedExpressions) : undefined,
4861
'included-labels': triageManagerOptions.includedLabels ? stringifyList(triageManagerOptions.includedLabels) : undefined,
@@ -95,6 +108,7 @@ export class IssueLabeler extends Component {
95108
areaIsKeyword: true,
96109
defaultArea: '{"reviewers":{"teamReviewers":["aws-cdk-owners"]}}',
97110
parameters: '[{"area":"pullrequests","keywords":["pullrequestkeyword"]}]',
111+
githubToken: GitHubToken.PROJEN_GITHUB_TOKEN,
98112
}));
99113
}
100114
}

0 commit comments

Comments
 (0)