Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
activity

GitHub Action

Recent GitHub Activity - Profile Readme

v1.3.0

Recent GitHub Activity - Profile Readme

activity

Recent GitHub Activity - Profile Readme

Add your recent activity to your profile readme

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Recent GitHub Activity - Profile Readme

uses: Readme-Workflows/recent-activity@v1.3.0

Learn more about this action in Readme-Workflows/recent-activity

Choose a version

Recent Activity

GitHub issues GitHub repo size Lines of code Discord Chat Contributor Covenant

This GitHub Action is a Fork of the original GitHub Activity Readme Action by jamesgeorge007.
Its our goal is to improve the original GitHub Action while also providing new features for the users.

Preview

image

Features

The core feature of this GitHub Action is to update your Profile README file, or any Markdown file, with the latest activities you made on GitHub.
Current activities include:

  • Issues (Opening, closing and commenting)
  • Pull requests (Opening, closing and merging)

Some other activities can't be displayed since they aren't parts of what GitHub's API returns as public events.

You can request a feature if you want to add some other events.

Contributing

Please read CONTRIBUTING.md file.

Setup a Profile README

If you're a beginner, then here is an article made by @abhijoshi2k that explains how you can create and manage your own Profile README.

The official GitHub documentation about Profile READMEs can be found here.

Setup

GitHub release (latest SemVer)

  • To get started, first make sure you add <!--START_SECTION:activity--> somewhere in your README.md file. This is where the list will appear when the action started. See below for more clear description for them.
  • Next should you now move on to creating a new Workflow. In this example we create .github/workflows/update-readme.yml
  • Now edit the YAML file and add the following content to it:
    name: Update README
    
    on:
      schedule:
        - cron: "*/30 * * * *"
      workflow_dispatch:
    
    jobs:
      build:
        runs-on: ubuntu-latest
        name: Update this repo's README with recent activity
    
        steps:
          - uses: actions/checkout@v2.3.4
          - uses: Readme-Workflows/recent-activity@{version} # Replace {version} with the latest available version on the Repository.
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    Notes:
    • The example above would be triggered every 30 minutes. A page explaining the Cron syntax in GitHub Workflows can be found here.
      You can also use Crontab.guru to create the right Cron-format to use.

Options

The Action has different Options that are set through HTML Comments (<!-- text -->) in the markdown file.
Some are required and some are optional. All comments are case-sensitive.

Option Description
RECENT_ACTIVITY:start Indicates the start of the Activity-list.
The list itself will be added **below** this comment and finished of with the RECENT_ACTIVITY:end comment.
RECENT_ACTIVITY:last_update Sets the date of when the List was last updated.
The Text displayed is set in the Settings of the Action and will be added below this comment together with the RECENT_ACTIVITY:last_update_end comment.

Comments example

Below is a small example of how the Markdown could look like:

## Recent Activity
This is a list of my most recent Activity on GitHub.
<!--RECENT_ACTIVITY:last_update-->
<!--RECENT_ACTIVITY:start-->

And this would be the result of it:

## Recent Activity
This is a list of my most recent Activity on GitHub.
<!--RECENT_ACTIVITY:last_update-->
Last updated: `01.01.2021 00:00`
<!--RECENT_ACTIVITY:last_update_end-->
<!--RECENT_ACTIVITY:start-->
1. ❗️ Closed issue [#5](https://github.com/Readme-Workflows/recent-activity/issues/5) in [Readme-Workflows/recent-activity](https://github.com/Readme-Workflows/recent-activity/issues/5)
2. 🎉 Merged PR [#6](https://github.com/Readme-Workflows/recent-activity/pull/6) in [Readme-Workflows/recent-activity](https://github.com/Readme-Workflows/recent-activity/pull/6)
3. 🗣 Commented on [#3](https://github.com/Readme-Workflows/recent-activity/discussions/3) in [Readme-Workflows/recent-activity](https://github.com/Readme-Workflows/recent-activity/discussions/3)
4. ❗️ Closed issue [#4](https://github.com/Readme-Workflows/recent-activity/issues/4) in [Readme-Workflows/recent-activity](https://github.com/Readme-Workflows/recent-activity/issues/4)
5. 💪 Opened PR [#6](https://github.com/Readme-Workflows/recent-activity/pull/6) in [Readme-Workflows/recent-activity](https://github.com/Readme-Workflows/recent-activity/pull/6)
<!--RECENT_ACTIVITY:end-->

Settings

The Action currently has the following Settings that you can set through the with option.

Option Description Default Supported Placeholder
GH_USERNAME The User to get latest activity from Repository Owner
COMMIT_MSG The Commit Message to use when updating the README ⚡ Update README with the recent activity
MAX_LINES How many activities to display 5
README_FILE The location of the README.md (or any Markdown file) relative to the root directory. ./README.md
COMMENTS_ACTIVITY Text displayed for making a comment.
Includes comments on Issues and Pull requests
🗣 Commented on {ID} in {REPO} {REPO}
{ID}
{URL}
ISSUE_OPENED Text displayed for opening an issue. ❗️ Opened issue {ID} in {REPO} {REPO}
{ID}
{URL}
ISSUE_CLOSED Text displayed for closing an issue. ❗️ Closed issue {ID} in {REPO} {REPO}
{ID}
{URL}
PR_OPENED Text displayed for opening a Pull request. 💪 Opened PR {ID} in {REPO} {REPO}
{ID}
{URL}
PR_CLOSED Text displayed for closing a Pull request without merging. ❌ Closed PR {ID} in {REPO} {REPO}
{ID}
{URL}
PR_MERGED Text displayed for merging a Pull request. 🎉 Merged PR {ID} in {REPO} {REPO}
{ID}
{URL}
DISABLE_EVENTS Comma-separated String of Events to disable.
Available are ISSUE, PR and COMMENTS
Empty String
URL_TEXT Text to display when using the {URL} placeholder.See the Placeholders section for more info. {REPO}{ID} {REPO}
{ID}
TIMEZONE_OFFSET Timezone in which the date and time should be displayed.
The format is +xx:xx / -xx:xx and is relative to the GMT timezone.
0
DATE_STRING The text to print when using the RECENT_ACTIVITY:last_update Comment option. Last Updated: {DATE} {DATE}
DATE_FORMAT The date and time format which should be used for the {DATE} Placeholder.
More info about the Date formatting
dddd, mmmm dS, yyyy, h:MM:ss TT

Placeholders

The following placeholders may be used in the aforementioned settings, if the Supported Placeholders section lists them.

Important Notes:

  • Each placeholder with exception of {DATE} will turn into an embedded link pointing to the issue, pull request or discussion of that respective action.
    For example will {ID} turn into [#:id](:url) and {URL} turns into [:url_text](:url).
  • Using {ID} or {REPO} in the URL_TEXT setting won't turn them into embedded links. {ID} will still have a # before it.
Placeholder Description Example Output
{REPO} Displays the username and Repository in the :username/:repository format. Readme-Workflows/recent-activity
{ID} Displays the issue, pull request or discussion ID with a # added in front of it #1
{URL} Displays the text provided by URL_TEXT. Readme-Workflows/recent-activity#1
{DATE} Current time and date to display.
This is ONLY usable in the DATE_STRING setting!
01.01.2021 00:00:00

History

  • The original project was inspired by JasonEtco/activity-box
  • Puneet and Abhishek wanted to add a new feature, the original project was no longer maintained, so Puneet created a fork and Abhishek supported him.

Examples

A list of examples can be found on the Wiki

Community

Get updates on Recent Activity's development and chat with the Recent Activity maintainers and community members.

Please see the SUPPORT.md file for links.

Supporters

👏 A big thank you goes to all the supporters of this project!

You prove that the Recent-Activity Action has some value for you!

Stargazers

Stargazers for @Readme-Workflows/recent-activity

Contributors

Thanks to all contributors again!

GitHub Contributors Image

Roadmap

Visit our Roadmap for planned and upcoming features.

Support us

Do you like this project? Why don't show your support by staring it and joining all the other stargazers?