Skip to content

Commit

Permalink
Merge pull request #31 from hashicorp/copyright-header
Browse files Browse the repository at this point in the history
chore: add copyright header automation
  • Loading branch information
ansgarm authored Mar 3, 2023
2 parents a0d46ff + 381816d commit 498d726
Show file tree
Hide file tree
Showing 12 changed files with 399 additions and 282 deletions.
16 changes: 16 additions & 0 deletions .copywrite.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
schema_version = 1

project {
license = "MPL-2.0"
copyright_year = 2021

# (OPTIONAL) A list of globs that should not have copyright/license headers.
# Supports doublestar glob patterns for more flexibility in defining which
# files or folders should be ignored
header_ignore = [
# "vendors/**",
# "**autogen**",
"**/node_modules/**",
"action.yml"
]
}
6 changes: 6 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: 0 additions & 4 deletions .projen/deps.json

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

17 changes: 16 additions & 1 deletion .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ new TextFile(project, "src/inputs.ts", {
committed: true,
marker: true,
lines: [
`import * as core from "@actions/core";`,
`/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import * as core from "@actions/core";`,
"",
Object.entries(inputs)
.map(
Expand All @@ -158,4 +163,14 @@ new TextFile(project, "src/inputs.ts", {
});
project.prettier?.addIgnorePattern("src/inputs.ts");

// Add copywrite headers to all files
project.buildWorkflow?.addPostBuildSteps(
{
name: "Setup Copywrite tool",
uses: "hashicorp/setup-copywrite@3ace06ad72e6ec679ea8572457b17dbc3960b8ce", // v1.0.0
with: { token: "${{ secrets.GITHUB_TOKEN }}" },
},
{ name: "Add headers using Copywrite tool", run: "copywrite headers" }
);

project.synth();
10 changes: 8 additions & 2 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions dist/sourcemap-register.js

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions package.json

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

5 changes: 5 additions & 0 deletions src/inputs.ts

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

4 changes: 2 additions & 2 deletions tsconfig.dev.json

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

4 changes: 2 additions & 2 deletions tsconfig.json

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

Loading

0 comments on commit 498d726

Please sign in to comment.