/license-generator

The GitHub action that using template to generate license.

Primary LanguageJavaScriptMIT LicenseMIT

⚡️ License Generator GitHub Action

sync2gitee(list) licenseGenerator Github last commit Github latest release Github license

A GitHub actions that use default template to generate license.

🎨 Table of Contents

✅ Support license table

License Configuration Build
MIT path, year, author MIT
CC0-1.0 path, year, author, work CC0-1.0
CC-BY-4.0 path, year, author, work CC-BY-4.0
CC-BY-NC-4.0 path, year, author, work CC-BY-NC-4.0
CC-BY-ND-4.0 path, year, author, work CC-BY-ND-4.0
CC-BY-SA-4.0 path, year, author, work CC-BY-SA-4.0
CC-BY-NC-ND-4.0 path, year, author, work CC-BY-NC-ND-4.0
CC-BY-NC-SA-4.0 path, year, author, work CC-BY-NC-SA-4.0

🚀 Configuration

inputs:
  path:
    description: 'Set up the path of license.'
    required: false
    default: LICENSE
  type:
    description: 'Set up the type of license.'
    required: false
    default: MIT
  year:
    description: 'Set up the year when to since from of license.'
    required: false
    default: none
  author:
    description: 'Set up the author of license.'
    required: false
    default: ${{ github.actor }}
  work:
    description: 'Set up the work name of license.'
    required: false
    default: ${{ github.repository }}

📝 Example usage for show license generated

This file is build in ./github/workflows/licenseGenerator.yml to keep license up-to-date every month.

name: licenseGenerator
on:
  schedule:
    - cron: '1 1 1 * *'

jobs:
  run:
    name: Generate License
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2.3.4

      - name: Generate License
        uses: yi-Xu-0100/license-generator@v0.1.0
        with:
          path: LICENSE
          type: MIT
          year: 2020
          author: yi_Xu

      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v3.6.0
        with:
          commit-message: Update LICENSE
          branch: update-license-patch
          delete-branch: true
          title: '[action] Update LICENSE'
          body: |
            Update LICENSE

            - LICENSE generate with [license-generator][0]
            - Auto-generated by [create-pull-request][1]

            [0]: https://github.com/yi-Xu-0100/license-generator
            [1]: https://github.com/peter-evans/create-pull-request

          labels: |
            LICENSE
            automated pr
            GitHub action

📝 Use dependabot to keep action up-to-date

This file is build in ./github/dependabot.yml to keep action up-to-date.

version: 2
updates:
  # Maintain dependencies for GitHub Actions
  - package-ecosystem: 'github-actions'
    directory: '/'
    schedule:
      interval: 'daily'

🔊 CHANGELOG

📄 LICENSE