diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 682495f..184fcd9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,8 @@ jobs: run: yarn install --check-files - name: build run: npx projen build + - name: Lint the YAML files generated by Projen to define GitHub Actions workflows + run: npx projen validate-workflows - name: Setup Copywrite tool uses: hashicorp/setup-copywrite@867a1a2a064a0626db322392806428f7dc59cb3e - name: Add headers using Copywrite tool diff --git a/.github/workflows/upgrade-cdktf.yml b/.github/workflows/upgrade-cdktf.yml index 0ad2b4e..f032def 100644 --- a/.github/workflows/upgrade-cdktf.yml +++ b/.github/workflows/upgrade-cdktf.yml @@ -48,10 +48,10 @@ jobs: body: |- This PR initiates the upgrade of CDKTF from version `${{ steps.current_version.outputs.value }}` to version `${{ steps.latest_version.outputs.value }}`. Unfortunately, not everything can be automated, and the following steps need to be completed manually: - + - [ ] Update `@cdktf/provider-null` to a version compatible with `cdktf@${{ steps.latest_version.outputs.value }}` [here](https://github.com/cdktf/construct-projen-template/blob/d62067602139725e957e516ef41d94c384af731a/.projenrc.ts#L84). Look up the version [here](https://github.com/cdktf/cdktf-provider-null/releases/). - [ ] Run `npx projen` - + Please checkout this PR, complete the above steps, push the changes to this branch, and then mark this PR as ready for review to complete the upgrade. Thanks! labels: automerge,auto-approve,dependencies token: ${{ secrets.PROJEN_GITHUB_TOKEN }} diff --git a/.projen/deps.json b/.projen/deps.json index c04cfb5..03d2d30 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -1,13 +1,5 @@ { "dependencies": [ - { - "name": "@action-validator/cli", - "type": "build" - }, - { - "name": "@action-validator/core", - "type": "build" - }, { "name": "@types/jest", "type": "build" diff --git a/.projen/tasks.json b/.projen/tasks.json index df0f606..7e55876 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -167,9 +167,6 @@ "steps": [ { "spawn": "docgen" - }, - { - "spawn": "validate-workflows" } ] }, @@ -254,13 +251,13 @@ "exec": "yarn upgrade npm-check-updates" }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@action-validator/cli,@action-validator/core,@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,change-case,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,jest,jest-junit,jsii-diff,jsii-docgen,jsii-pacmak,jsii-rosetta,jsii,npm-check-updates,prettier,projen,standard-version,ts-jest,ts-node,typescript" + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,change-case,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,jest,jest-junit,jsii-diff,jsii-docgen,jsii-pacmak,jsii-rosetta,jsii,npm-check-updates,prettier,projen,standard-version,ts-jest,ts-node,typescript" }, { "exec": "yarn install --check-files" }, { - "exec": "yarn upgrade @action-validator/cli @action-validator/core @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser change-case constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint jest jest-junit jsii-diff jsii-docgen jsii-pacmak jsii-rosetta jsii npm-check-updates prettier projen standard-version ts-jest ts-node typescript" + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser change-case constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint jest jest-junit jsii-diff jsii-docgen jsii-pacmak jsii-rosetta jsii npm-check-updates prettier projen standard-version ts-jest ts-node typescript" }, { "exec": "npx projen" @@ -272,10 +269,10 @@ }, "validate-workflows": { "name": "validate-workflows", - "description": "Lint the YAML files generated by Projen to define GitHub Actions and Workflows, checking them against published JSON schemas", + "description": "Lint the YAML files generated by Projen to define GitHub Actions and Workflows using yamllint (installed in CI)", "steps": [ { - "exec": "find ./.github/workflows -type f -name \"*.yml\" -print0 | xargs -0 -n 1 npx action-validator" + "exec": "find ./.github/workflows -type f -name \"*.yml\" -print0 | xargs -0 yamllint -d relaxed" } ] }, diff --git a/.projenrc.ts b/.projenrc.ts index 675c9d5..3bcf4a2 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -87,8 +87,6 @@ project.addPeerDeps( ); project.addDevDeps( "change-case", - "@action-validator/core", - "@action-validator/cli", "node-fetch@~2" // @TODO this can be removed once we upgrade to Node 18 and use native fetch ); @@ -99,11 +97,14 @@ new UpgradeCDKTF(project); new UpgradeNode(project); const validateTask = project.addTask("validate-workflows", { - exec: `find ./.github/workflows -type f -name "*.yml" -print0 | xargs -0 -n 1 npx action-validator`, + exec: `find ./.github/workflows -type f -name "*.yml" -print0 | xargs -0 yamllint -d relaxed`, }); validateTask.description = - "Lint the YAML files generated by Projen to define GitHub Actions and Workflows, checking them against published JSON schemas"; -project.postCompileTask.spawn(validateTask); + "Lint the YAML files generated by Projen to define GitHub Actions and Workflows using yamllint (installed in CI)"; +project.buildWorkflow?.addPostBuildSteps({ + name: "Lint the YAML files generated by Projen to define GitHub Actions workflows", + run: "npx projen validate-workflows", +}); // for local developing (e.g. linking local changes to cdktf) project.addGitIgnore(".yalc"); diff --git a/package.json b/package.json index 857c172..d85fc13 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,6 @@ "organization": true }, "devDependencies": { - "@action-validator/cli": "^0.5.3", - "@action-validator/core": "^0.5.3", "@cdktf/provider-null": "9.0.0", "@types/jest": "^29.5.6", "@types/node": "^18", diff --git a/projenrc/upgrade-cdktf.ts b/projenrc/upgrade-cdktf.ts index 56f3d7b..e24d3c7 100644 --- a/projenrc/upgrade-cdktf.ts +++ b/projenrc/upgrade-cdktf.ts @@ -77,12 +77,10 @@ export class UpgradeCDKTF { "chore!: upgrade to cdktf ${{ steps.latest_version.outputs.value }}", body: [ "This PR initiates the upgrade of CDKTF from version `${{ steps.current_version.outputs.value }}` to version `${{ steps.latest_version.outputs.value }}`.", - "Unfortunately, not everything can be automated, and the following steps need to be completed manually:", - " ", + "Unfortunately, not everything can be automated, and the following steps need to be completed manually:\n", "- [ ] Update `@cdktf/provider-null` to a version compatible with `cdktf@${{ steps.latest_version.outputs.value }}` [here](https://github.com/cdktf/construct-projen-template/blob/d62067602139725e957e516ef41d94c384af731a/.projenrc.ts#L84). Look up the version [here](https://github.com/cdktf/cdktf-provider-null/releases/).", "- [ ] Run `npx projen`", - " ", - "Please checkout this PR, complete the above steps, push the changes to this branch, and then mark this PR as ready for review to complete the upgrade. Thanks!", + "\nPlease checkout this PR, complete the above steps, push the changes to this branch, and then mark this PR as ready for review to complete the upgrade. Thanks!", ].join("\n"), labels: "automerge,auto-approve,dependencies", token: "${{ secrets.PROJEN_GITHUB_TOKEN }}", diff --git a/yarn.lock b/yarn.lock index dd51b06..282117e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,18 +7,6 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@action-validator/cli@^0.5.3": - version "0.5.3" - resolved "https://registry.yarnpkg.com/@action-validator/cli/-/cli-0.5.3.tgz#2d4fe473058f6ef17530b9bb5929f0eade4e8672" - integrity sha512-u/kv77ZC55PfAc9RQeP76xV1GysTisEJjO+b5TgCrBBcaKtGLt5Y7ki2GSdc7CDzncNc1oeoGcwaLMW6JSdQAw== - dependencies: - chalk "5.2.0" - -"@action-validator/core@^0.5.3": - version "0.5.3" - resolved "https://registry.yarnpkg.com/@action-validator/core/-/core-0.5.3.tgz#493b850ef7a2801830069d78f60cbefe0697423f" - integrity sha512-0ABelaY7nmpvV5q0z8Vl1cDeq2OZ1HyNXjXS54fBadLaCssZLbDvTa7M2uUaNMcEWV+Xl48WWbnqJWKePt9qHQ== - "@ampproject/remapping@^2.2.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" @@ -1739,11 +1727,6 @@ cdktf@0.19.0: json-stable-stringify "^1.0.2" semver "^7.5.3" -chalk@5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.2.0.tgz#249623b7d66869c673699fb66d65723e54dfcfb3" - integrity sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA== - chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"