diff --git a/.copywrite.hcl b/.copywrite.hcl new file mode 100644 index 0000000..9785491 --- /dev/null +++ b/.copywrite.hcl @@ -0,0 +1,15 @@ +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/**", + ] +} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ecc3fbf..05ae26b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,12 @@ jobs: run: yarn install --check-files - name: build run: npx projen build + - name: Setup Copywrite tool + uses: hashicorp/setup-copywrite@3ace06ad72e6ec679ea8572457b17dbc3960b8ce + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Add headers using Copywrite tool + run: copywrite headers - name: Find mutations id: self_mutation run: |- diff --git a/.projenrc.ts b/.projenrc.ts index edfe0bc..3170647 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -158,4 +158,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();