Skip to content

GitHub Update README is a GitHub Action to regularly update your profile README to display customisable content.

License

Notifications You must be signed in to change notification settings

mnjirjak/github-update-readme

 
 

Repository files navigation

github-update-readme

License: GPL v3

Example of profile README

About

This GitHub Action updates your profile README.md to show your latest activity.

Inputs

header

Required The header of your README.md. Markdown supported.

subhead

The subheader of your README.md. Markdown supported. Default "".

footer

The footer of your README.md. Markdown supported. Default "".

path

Path of your README.md file. Default "README.md".

ref

Override the default branch/tag ref. Default "master".

repoCount

Number of repositories to load. Default "6".

reposPerRow

Number of repositories to load per row. Default "3".

imageSize

Length (in pixels) of each side of the square image. Default "150".

excludeActivity

Types of event to exclude from the recent activity table in a JSON array. Recent events, such as "PushEvent" or "ForkEvent", can be found at https://api.github.com/users/{username}/events, replacing username with your username. Example input would be '["WatchEvent", "ForkEvent"]'. Default "[]".

excludeRepo

Repositories to exclude from the recent activity table in a JSON array. Example input would be '["theboi/theboi", "username/repo"]'. Default "[]".

customReadmeFile

Customise the README.md file format without forking this repository. Markdown supported.

Use these reserved strings wrapped in ${ and } (For instance, ${header}) to reference certain content:

  • repoTable: Set of tables with most recent repository activity.
  • header
  • subhead
  • footer
Default: |
  ## ${header}
      
  ${subhead}

  ---
      
  ${repoTable}
      
  ---
      
  ${footer}

Note: | denotes a multiline string block in YAML. Ensure you indent properly when setting this.

Environment Inputs

GITHUB_TOKEN

Required Set this to: ${{ secrets.GITHUB_TOKEN }}

Outputs

repositories

Array of recent repositories to be displayed on your profile README.md.

Example usage

- name: Update GitHub Profile README
  uses: theboi/github-update-readme@v1.0
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  with:
    header: "Hey, I'm Ryan! 👋"
    subhead: "Currently a student in Singapore, passionate about creating all-things-tech to improve society."
    footer: "**Learn more about me at [ryanthe.com](https://www.ryanthe.com)!**"
  • You might want to schedule this to run every 10 mins, paste this under on:
schedule:
  - cron: "*/10 * * * *"
  • This will now run and fetch repositories you were most recently active on, every 10 mins.
  • Important Add a DISPLAY.jpg to your repositories (including username/username) to show in the table. If image does not exist, will default to DISPLAY.jpg on username/username.

Note

  • Due to GitHub's API rate-limiting, this GitHub Action will, at most, only check your 1000 most recent activities.
  • This is also my first GitHub Action so feel free to suggest improvements/submit a PR. Thanks!

About

GitHub Update README is a GitHub Action to regularly update your profile README to display customisable content.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%