Skip to content

Commit

Permalink
chore(ci): validate workflows as part of builds (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiehan authored Aug 28, 2024
1 parent 16cdfbe commit 8e5e6ff
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .projen/deps.json

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

16 changes: 14 additions & 2 deletions .projen/tasks.json

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

3 changes: 3 additions & 0 deletions package.json

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

9 changes: 9 additions & 0 deletions projenrc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ export class TerraformCdkActionProject extends GitHubActionTypeScriptProject {
"projen-github-action-typescript@^0.0.395",
"@types/fs-extra",
"action-docs",
"@action-validator/core",
"@action-validator/cli",
],
peerDeps: ["constructs@^10.0.0"],
minNodeVersion: "20.9.0",
Expand Down Expand Up @@ -175,6 +177,13 @@ import * as core from "@actions/core";`,
{ name: "Add headers using Copywrite tool", run: "copywrite headers" }
);

const validateTask = this.addTask("validate-workflows", {
exec: `find ./.github/workflows -type f -name "*.yml" -print0 | xargs -0 -n 1 npx action-validator`,
});
validateTask.description =
"Lint the YAML files generated by Projen to define GitHub Actions and Workflows, checking them against published JSON schemas";
this.postCompileTask.spawn(validateTask);

// Add a step to notify Slack after a successful release
// This is because we can't automate updating the Marketplace, sadly
this.release?.addJobs({
Expand Down
17 changes: 17 additions & 0 deletions yarn.lock

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

0 comments on commit 8e5e6ff

Please sign in to comment.