|
1 | | -generate-license-file-github-action |
| 1 | +# generate-license-file GitHub Action |
| 2 | + |
| 3 | +GitHub Action to generate a text file asset containing all of the licenses for your production npm third-party dependencies. |
| 4 | + |
| 5 | +<p> |
| 6 | + <a href="https://github/TobyAndToby/generate-license-file-github-action/releases"> |
| 7 | + <img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/TobyAndToby/generate-license-file-github-action?label=GitHub%20Action"> |
| 8 | + </a> |
| 9 | + <a href="https://codecov.io/github/TobyAndToby/generate-license-file-github-action"> |
| 10 | + <img src="https://codecov.io/github/TobyAndToby/generate-license-file-github-action/branch/main/graph/badge.svg"/> |
| 11 | + </a> |
| 12 | +</p> |
| 13 | + |
| 14 | +Based on the npm package [generate-licence-file](https://www.npmjs.com/package/generate-license-file). |
| 15 | + |
| 16 | +## Usage |
| 17 | + |
| 18 | +To run the Action, supply your package.json path as `input`, and your desired output file as `output`. |
| 19 | + |
| 20 | +```yaml |
| 21 | +jobs: |
| 22 | + myJob: |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v2 |
| 25 | + |
| 26 | + - uses: generate-licence-file@latest |
| 27 | + name: Generate License File |
| 28 | + with: |
| 29 | + input: "./package.json" |
| 30 | + output: "./third-party-licenses.txt" |
| 31 | +``` |
| 32 | +
|
| 33 | +You can also specify which line ending you would like it to use, either `windows` for ` crlf` or `posix` for `lf`. If you don't supply one it will use the build agents default. |
| 34 | + |
| 35 | +```yaml |
| 36 | +jobs: |
| 37 | + myJob: |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v2 |
| 40 | +
|
| 41 | + - uses: generate-licence-file@latest |
| 42 | + name: Generate License File |
| 43 | + with: |
| 44 | + input: "./package.json" |
| 45 | + output: "./third-party-licenses.txt" |
| 46 | + lineEnding: posix |
| 47 | +``` |
| 48 | + |
| 49 | +## Building the action yourself |
| 50 | + |
| 51 | +```bash |
| 52 | +npm install |
| 53 | +npm run build |
| 54 | +``` |
| 55 | + |
| 56 | +A Husky pre-commit hook will automatically build and commit the dist directory on each commit to ensure that the committed JavaScript code is always up to date. |
| 57 | + |
| 58 | +## License |
| 59 | + |
| 60 | +generate-license-file-github-action is licensed under the [ISC License](./LICENSE.md). |
0 commit comments