-
Notifications
You must be signed in to change notification settings - Fork 1
/
.projenrc.ts
72 lines (67 loc) · 1.87 KB
/
.projenrc.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { CdklabsJsiiProject } from 'cdklabs-projen-project-types';
import { JobPermission } from 'projen/lib/github/workflows-model';
const RELEASE_EVERY_HOURS = 3;
const project = new CdklabsJsiiProject({
author: 'Amazon Web Services, Inc.',
projenrcTs: true,
private: false,
authorAddress: '[email protected]',
defaultReleaseBranch: 'main',
name: 'construct-hub-probe',
releaseToNpm: true,
minNodeVersion: '18.12.0',
workflowNodeVersion: '18.x',
setNodeEngineVersion: false,
repositoryUrl: 'https://github.com/cdklabs/construct-hub-probe.git',
peerDeps: [
'constructs',
'aws-cdk-lib',
],
devDeps: [
'cdklabs-projen-project-types',
],
jsiiTargetLanguages: [],
enablePRAutoMerge: true,
keywords: [
'construct-hub',
'probe',
'dummy',
'construct-hub/hide-from-search',
],
});
if (!project.github) {
throw new Error('project.github is undefined. This would only happen if the project is a subproject, which it shouldn\'t be.');
}
const bump = project.github.addWorkflow('auto-commit');
const commitMessage = 'feat: auto commit to trigger new release';
bump.on({ schedule: [{ cron: `0 */${RELEASE_EVERY_HOURS} * * *` }], workflowDispatch: {} });
bump.addJobs({
bump: {
runsOn: ['ubuntu-latest'],
permissions: {
contents: JobPermission.READ,
},
steps: [
{
name: 'Checkout',
uses: 'actions/checkout@v2',
},
{
name: 'Bump',
run: 'echo $(date -Is) > commit.date',
},
{
name: 'Create Pull Request',
uses: 'peter-evans/create-pull-request@v3',
with: {
'token': '${{ secrets.PROJEN_GITHUB_TOKEN }}',
'commit-message': commitMessage,
'branch': 'github-actions/auto-commit',
'title': commitMessage,
'labels': 'auto-approve',
},
},
],
},
});
project.synth();