Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jaywcjlove/github-action-contributors

Github action generates dynamic image URL for contributor list to display it!
https://github.com/jaywcjlove/github-action-contributors

actions avatar avatar-generator contributors contributors-avatar github-actions svg

Last synced: about 12 hours ago
JSON representation

Github action generates dynamic image URL for contributor list to display it!

Awesome Lists containing this project

README

        

github-action-contributors
===

[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)
[![Build & Deploy](https://github.com/jaywcjlove/github-action-contributors/actions/workflows/ci.yml/badge.svg)](https://github.com/jaywcjlove/github-action-contributors/actions/workflows/ci.yml)
[![Repo Dependents](https://badgen.net/github/dependents-repo/jaywcjlove/github-action-contributors)](https://github.com/jaywcjlove/github-action-contributors/network/dependents)

Github action generates dynamic image URL for contributor list to display it!

The contributors list is fetched from [GitHub API](https://docs.github.com/cn/rest/repos/repos#list-repository-contributors).

## Contributors

As always, thanks to our amazing contributors!



Write contributors(**`htmlTable`**) to markdown Example:



小弟调调

小弟调调

Bot Users:



github-actions[bot]

github-actions[bot]




renovate[bot]

renovate[bot]

Collaborators Users:



小弟调调

小弟调调

Write contributors(**`htmlList`**) to markdown Example:

小弟调调

## Usage

```yml
- run: mkdir -p build
- name: Generate Contributors Images
uses: jaywcjlove/github-action-contributors@main
with:
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
output: build/CONTRIBUTORS.svg
avatarSize: 42

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
```

```
https://jaywcjlove.github.io/github-action-contributors/CONTRIBUTORS.svg
```

Use in markdown

```markdown
## Contributors

As always, thanks to our amazing contributors!



Made with [contributors](https://github.com/jaywcjlove/github-action-contributors).
```



### Write contributors(**`htmlList`**) to markdown

```yml
- name: Generate Contributors Images
uses: jaywcjlove/github-action-contributors@main
id: contributors
with:
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
avatarSize: 42

- name: Modify README.md
uses: jaywcjlove/github-action-modify-file-content@main
with:
path: README.md
body: '${{steps.contributors.outputs.htmlList}}'
```

Use in `README.md` markdown

```markdown
## Contributors

As always, thanks to our amazing contributors!

小弟调调

Made with [contributors](https://github.com/jaywcjlove/github-action-contributors).
```

Write contributors(**`htmlList`**) to markdown Example:

小弟调调

### Write contributors(**`htmlTable`**) to markdown

```yml
- name: Generate Contributors Images
uses: jaywcjlove/github-action-contributors@main
id: contributors
with:
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
openDelimiter: ''
closeDelimiter: ''
hideName: 'true' # Hide names in htmlTable
avatarSize: 100 # Set the avatar size.

- name: Modify htmlTable README.md
uses: jaywcjlove/github-action-modify-file-content@main
with:
path: README.md
body: '${{steps.contributors.outputs.htmlTable}}'
```

Use in `README.md` markdown

```markdown
## Contributors

As always, thanks to our amazing contributors!

will be replaced here

Made with [contributors](https://github.com/jaywcjlove/github-action-contributors).
```

Write contributors(**`htmlTable`**) to markdown Example:



小弟调调

Bot Users:



github-actions[bot]




renovate[bot]

## Inputs

- `token` - Your `GITHUB_TOKEN`. This is required. Why do we need `token`? Read more here: [About the GITHUB_TOKEN secret](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token#about-the-github_token-secret). Default: `${{ github.token }}`
- `filter-author` - Regular expression filtering'.
- `count` - Specify the max count of contributors listed. Default list all contributors(max 100).
- `output` - output image path. default: `CONTRIBUTORS.svg`
- `truncate` - Truncate username by specified length, `0` for no truncate. default: `12`
- `svgWidth` - Width of the generated SVG. default: `740`
- `avatarSize` - Size of user avatar. default: `24`
- `avatarMargin` - Margin of user avatar. default: `5`
- `hideName` - Hide names in `htmlTable`
- `userNameHeight` - Height of user name. default: `0`
- `svgTemplate` - Template to render SVG.

```xml

.contributor-link { cursor: pointer; }
{{{ contributors }}}

```

## Outputs

- `svg` svg image string: ` form string
- `htmlTableBots` Contributor(Bot Users) HTML \ form string
- `htmlList` Contributor HTML \ list form string
- `htmlListBots` Contributor(Bot Users) HTML \
list form string
- `htmlCollaboratorsTable` Collaborators user HTML
form string
- `htmlCollaboratorsTableBots` Collaborators user(Bot Users) HTML form string
- `htmlCollaboratorsList` Collaborators user HTML list form string
- `htmlCollaboratorsListBots` Collaborators user(Bot Users) HTML
form string

### `htmlTable`

```html




jaywcjlove

jaywcjlove


```

### `htmlList`

```html

jaywcjlove


github-actions[bot]
小弟调调

Made with [contributors](https://github.com/jaywcjlove/github-action-contributors).

## License

Licensed under the MIT License.