Coder Social home page Coder Social logo

contributors-list's Introduction

Contributors List

build MIT License Language PRs Welcome website Language grade: JavaScript

Automatically generate contributors.svg for your repository

Usage

Create a workflow file such as .github/workflows/contributors.yml:

name: Contributors
on:
  schedule:
    - cron: '0 1 * * 0' # At 01:00 on Sunday.
  push:
    branches:
      - master
jobs:
  contributors:
    runs-on: ubuntu-latest
    steps:
      - uses: wow-actions/contributors-list@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          svgPath: CONTRIBUTORS.svg

Inputs

Various inputs are defined to let you configure the action:

Note: Workflow command and parameter names are not case-sensitive.

  • sort: Specify if sort contributors by contributions or not. Default: true.
  • round: Specify if clip the avatar to rounded or not. Default: true.
  • count: Specify the max count of contributors listed. Default list all contributors.
  • truncate: Truncate username by specified length, 0 for no truncate. Default: 12.
  • affiliation: Specify the type of collaborators. Default: direct. Options: all/direct/outside.
    • 'outside': All outside collaborators of an organization-owned repository.
    • 'direct': All collaborators with permissions to an organization-owned repository, regardless of organization membership status.
    • 'all': All collaborators the authenticated user can see.
  • includeBots: Specify if include bots in the contributors list or not. Default true.
  • excludeUsers: Users separated by space to exclude in the contributors list.
  • svgPath: The path to save generated SVG. Default 'CONTRIBUTORS.svg'.
  • svgWidth: Width of the generated SVG. Default: 740.
  • avatarSize: Size of user avatar. Default: 64.
  • avatarMargin: Margin of user avatar. Default: 5.
  • userNameHeight: Height of user name. Default: 0.
  • svgTemplate: Template to render SVG. Default:
    <svg
      xmlns="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      version="1.1"
      width="{{ width }}"
      height="{{ contributorsHeight }}"
    >
      <style>
        .contributor-link {
          cursor: pointer;
        }
      </style>
      {{{ contributors }}}
    </svg>
  • itemTemplate: Template to render user item. Default:
    <a
      id="{{{ name }}}"
      title="{{{ name }}}"
      xlink:href="{{{ url }}}"
      class="contributor-link"
      target="_blank"
      rel="nofollow sponsored"
    >
      <image
        x="{{ x }}"
        y="{{ y }}"
        width="{{ width }}"
        height="{{ height }}"
        xlink:href="{{{ avatar }}}"
      />
    </a>
  • commitMessage: Commit message of the github action. Default: 'chore: update contributors'
  • noCommit: Changes will not be committed. This options requires a local clone and will updated if required the contributor svg. Default: false.

Examples

Rounded Avatar

name: Contributors
on:
  schedule:
    - cron: '0 1 * * 0' # At 01:00 on Sunday.
  push:
    branches:
      - master
jobs:
  contributors:
    runs-on: ubuntu-latest
    steps:
      - uses: wow-actions/contributors-list@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          round: true

Squared Avatar

name: Contributors
on:
  schedule:
    - cron: '0 1 * * 0' # At 01:00 on Sunday.
  push:
    branches:
      - master
jobs:
  contributors:
    runs-on: ubuntu-latest
    steps:
      - uses: wow-actions/contributors-list@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          round: false

With UserName

name: Contributors
on:
  schedule:
    - cron: '0 1 * * 0' # At 01:00 on Sunday.
  push:
    branches:
      - master
jobs:
  contributors:
    runs-on: ubuntu-latest
    steps:
      - uses: wow-actions/contributors-list@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          userNameHeight: 19
          itemTemplate: >
            <g transform="translate({{ x }}, {{ y }})">
              <a xlink:href="{{{ url }}}" class="contributor-link" target="_blank" rel="nofollow sponsored" title="{{{ name }}}" id="{{{ name }}}">
                <image width="{{ width }}" height="{{ height }}" xlink:href="{{{ avatar }}}" />
                <text x="32" y="74" text-anchor="middle" alignment-baseline="middle" font-size="10">{{{ name }}}</text>
              </a>
            </g>

Only Bots

name: Contributors
on:
  schedule:
    - cron: '0 1 * * 0' # At 01:00 on Sunday.
  push:
    branches:
      - master
jobs:
  contributors:
    runs-on: ubuntu-latest
    steps:
      - uses: wow-actions/contributors-list@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          svgTemplate: >
            <svg
              xmlns="http://www.w3.org/2000/svg"
              xmlns:xlink="http://www.w3.org/1999/xlink"
              version="1.1"
              width="{{ width }}"
              height="{{ botsHeight }}"
            >
              <style>.contributor-link { cursor: pointer; }</style>
              {{{ bots }}}
            </svg>

Only Collaborators

name: Contributors
on:
  schedule:
    - cron: '0 1 * * 0' # At 01:00 on Sunday.
  push:
    branches:
      - master
jobs:
  contributors:
    runs-on: ubuntu-latest
    steps:
      - uses: wow-actions/contributors-list@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          svgTemplate: >
            <svg
              xmlns="http://www.w3.org/2000/svg"
              xmlns:xlink="http://www.w3.org/1999/xlink"
              version="1.1"
              width="{{ width }}"
              height="{{ collaboratorsHeight }}"
            >
              <style>.contributor-link { cursor: pointer; }</style>
              {{{ collaborators }}}
            </svg>

Contributors And Bots

name: Contributors
on:
  schedule:
    - cron: '0 1 * * 0' # At 01:00 on Sunday.
  push:
    branches:
      - master
jobs:
  contributors:
    runs-on: ubuntu-latest
    steps:
      - uses: wow-actions/contributors-list@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          includeBots: false
          svgTemplate: |
            <svg
              xmlns="http://www.w3.org/2000/svg"
              xmlns:xlink="http://www.w3.org/1999/xlink"
              version="1.1"
              width="{{ width }}"
              height="{{#sum}} {{ contributorsHeight }} +  {{ botsHeight }} + 32 + 32 {{/sum}}"
            >
              <style>.contributor-link { cursor: pointer; }</style>

              <text x="5" y="8" text-anchor="start" alignment-baseline="before-edge" font-size="24">Contributors</text>
              <g transform="translate(0, 32)">
                {{{ contributors }}}
              </g>

              <text x="5" y="{{#sum}} {{ contributorsHeight }} + 32 + 8 {{/sum}}" text-anchor="start" alignment-baseline="before-edge" font-size="24">Bots</text>
              <g transform="translate(0, {{#sum}} {{ contributorsHeight }} + 32 + 32 {{/sum}})">
                {{{ bots }}}
              </g>
            </svg>

Contributors, Bots And Collaborators

name: Contributors
on:
  schedule:
    - cron: '0 1 * * 0' # At 01:00 on Sunday.
  push:
    branches:
      - master
jobs:
  contributors:
    runs-on: ubuntu-latest
    steps:
      - uses: wow-actions/contributors-list@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          includeBots: false
          svgTemplate: |
            <svg
              xmlns="http://www.w3.org/2000/svg"
              xmlns:xlink="http://www.w3.org/1999/xlink"
              version="1.1"
              width="{{ width }}"
              height="{{#sum}} {{ contributorsHeight }} + {{ botsHeight }} + {{ collaboratorsHeight }} + 32 + 32 + 32 {{/sum}}"
            >
              <style>.contributor-link { cursor: pointer; }</style>

              <text x="5" y="5" text-anchor="start" alignment-baseline="before-edge" font-size="24">Contributors</text>
              <g transform="translate(0, 32)">
                {{{ contributors }}}
              </g>

              <text x="5" y="{{#sum}} {{ contributorsHeight }} + 32 + 8 {{/sum}}" text-anchor="start" alignment-baseline="before-edge" font-size="24">Bots</text>
              <g transform="translate(0, {{#sum}} {{ contributorsHeight }} + 32 + 32 {{/sum}})">
                {{{ bots }}}
              </g>

              <text x="5" y="{{#sum}} {{ contributorsHeight }} + {{ botsHeight }} + 32 + 32 + 8 {{/sum}}" text-anchor="start" alignment-baseline="before-edge" font-size="24">Collaborators</text>
              <g transform="translate(0, {{#sum}} {{ contributorsHeight }} + {{ botsHeight }} + 32 + 32 + 32 {{/sum}})">
                {{{ collaborators }}}
              </g>
            </svg>

License

The scripts and documentation in this project are released under the MIT License.

contributors-list's People

Contributors

bubkoo avatar npalm avatar wow-actions-bot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

contributors-list's Issues

the number of contributors is optional will be better.

Thank you for your project, it took me to get started with actions. But the generated image only contains the icons of 30 contributors at most. I think it would be better if the number of contributors is optional.

Does not display the complete list of contributors

Our project has totally 8 contributors, where 2 of them are bots (one bot is recognized by the system and the second is manually excluded), so that it should display 6. The generated SVG file contains incomplete list of contributors and displays only 5 of them.

Expected Behavior

It should display all list of contributors.

Current Behavior

Displays 5 out of 6 contributors.

Possible Solution

Steps To Reproduce

Additional Context

Your Environment

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Error while running git command: The process '/usr/bin/git' failed with exit code 128

Unfortunately this error doesn't have any additional information. Feel free to kindly ask the author of the publish major and minor tags plugin to add more helpful information.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Unable to sign commits for automated actions

Expected Behavior

On normal ciromstances we should have a way to sign the commit in the header with a commit signature but now it is not available.

Possible Solution

An attribute to give a signature key to the commit

Steps To Reproduce

Implement the action in your workflow with signature on commits enabled

Screenshots

image

指定 repo 参数后,运行报错

我希望 contributors 的更新单独用另一个仓库来维护,刚好也看到 contributors-list 是有 repo 这个参数选项的,但是指定之后,action 运行报错。

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.