项目作者: Parply

项目描述 :
Rainbow readme badges generated automatically for your readme
高级语言: Python
项目地址: git://github.com/Parply/readme-badge-colouriser.git
创建时间: 2020-10-15T02:54:23Z
项目社区:https://github.com/Parply/readme-badge-colouriser

开源协议:MIT License

下载


Rainbow badges 🏳️‍🌈


Example







Star Badge


Report Bug
·
Request Feature

Prep Work

  1. You need to update the markdown file(.md) with 2 comments. You can refer here for updating it.
  2. You’ll need a GitHub API Token with repo and user scope from here

    enabling the repo scope seems DANGEROUS

    but this GitHub Action only will allow committing the updated readme.

    • You can use this example to work it out
  3. You need to save the GitHub API Token in the repository secrets. You can find that in the Settings of your repository. Be sure to save those as the following.
    • GitHub Personal Access Token as GH_TOKEN=<your github access token>
  4. You can enable and disable feature flags based on requirements here. The only required flag is the GitHub API token.

This Action is best run on every push but dont worry it will only commit when colours are updated.

Update your Readme

Add a comment to your README.md like this:

  1. <!--START_SECTION:colourise-->
  2. <!--END_SECTION:colourise-->

These lines will be our entry-points for where the colour values will be modified and should work with multiple sections. An example can be seen here.

Profile Repository

You’ll need to get a GitHub Access Token with a repo and user scope and save it in the Repo Secrets GH_TOKEN = <Your GitHub Access Token>

Here is Sample Workflow File for running it:

  1. name: Rainbow badges
  2. # runs after every push.
  3. on: push
  4. jobs:
  5. update-readme:
  6. name: Update Readme with Rainbow badges
  7. runs-on: ubuntu-latest
  8. steps:
  9. - uses: Parply/readme-badge-colouriser@master
  10. with:
  11. GH_TOKEN: ${{ secrets.GH_TOKEN }}

Extras

If you want to change options, you can add multiple FLAGS in your workflow file.

  1. - uses: Parply/readme-badge-colouriser@master
  2. with:
  3. GH_TOKEN: ${{ secrets.GH_TOKEN }}
  4. SATURATION: "0.5"
  5. AUTHOR: "Parply"

Additional Flags


  • SATURATION Saturation used when creating the rainbow palette. Defaults to 1.0

  • LUMINOSITY Luminosity used when creating the rainbow palette. Defaults to 0.5

  • AUTHOR Name of the author committing to the readme. Defaults to rainbow bot

  • BRANCH Branch to commit to. Defaults to master

  • COMMIT_MESSAGE Message when committing. Defaults to Updated with rainbow badges


Made with Python 🐍.