Skip to content

Commit

Permalink
fix: switch from action-validator to yamllint (#20)
Browse files Browse the repository at this point in the history
Turns out action-validator wouldn't have caught the issue introduced in
#15 since it seems to be more concerned with schemas than with valid
YAML, so the next best solution is to run yamllint in CI.
  • Loading branch information
xiehan committed Oct 31, 2023
1 parent f56e079 commit dfa955c
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 45 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .github/workflows/upgrade-cdktf.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand All @@ -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");
Expand Down
2 changes: 0 additions & 2 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions projenrc/upgrade-cdktf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}",
Expand Down
17 changes: 0 additions & 17 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dfa955c

Please sign in to comment.