-
Notifications
You must be signed in to change notification settings - Fork 45
Configuration
Version 2 of the Recent-Activity Action provided a new Configuration file which allows a much easier setup of the action without the need to create dozens of with
options.
To get started, first make sure to have at least version 2.0.0 of the Action, as versions prior to it don't have the config options.
The latest version can be found on the Releases Section of this repository.
An example workflow should look something like this for you:
name: Update README
on:
schedule:
- cron: '*/30 * * * *' # Update every 30 minutes
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: Update Profile README
steps:
- uses: actions/checkout@v3
#
# "{version}" is a placeholder and should be replaced with the latest release of recent-activity
- uses: Readme-Workflows/recent-activity@{version}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
This setup will try to find and use a file called recent-activity.config.yml
inside the .github
directory.
If you want to change the location and/or name of the file used, add a CONFIG_FILE:
with-option to the action that points to the file relative to the root directory of your repository.
As an example, wanting to use a file called activity-config.yml
in the .github
directory will require you to set CONFIG_FILE: './.github/activity-config.yml
as a with-option.
The Action allows different Inputs through the usage of the with
option.
This input sets the name to use for getting the Activities to display.
This defaults to the owner of the Repository.
This input allows to change the location of the YAML file used as Configuration.
By default is this ./.github/recent-activity.config.yml
but can be changed to any alternative path relative to your Repository's root-directory.
You can find a sample Configuration file in the sample.yml
of the Repository.
The config file is split into two major sections: Settings and Messages.
Every option in the file is optional and will default to a specific value (See Default
section for what)
The Settings
area contains various settings to configure.
username
commit_msg
max_lines
readme_file
disabled_events
-
whitelisted_events
commit_name
commit_email
url_text
date.timezone
date.text
date.format
line_prefix
ignored_repos
Default: Repository Owner
The username
setting allows you to set the name of the GitHub user from which the Action should display the most recent activities.
Default:
⚡ Update README with the recent activity
This setting allows you to change what message is used for the Commit.
Default: 5
The max_lines
setting allows you to set, how many entries should be displayed in the Activity-list.
The total amount of entries can only be 100 and the Action will finish pre-maturely if it either doesn't find enough Activities to display, or hits a <!--RECENT_ACTIVITY:end-->
comment in the file.
Default:
./README.md
The readme_file
options sets the path relative to your repository's root-directory for where the Action should update the file.
Only valid Markdown files are supported.
Default:
Undefined
disabled_events
allows you to set a list of events that should be ignored when updating the activity list.
Please see the list of supported events for all the events you can disable.
The setting can be used in two ways:
-
option 1:
settings: disabled_events: [event1, event2, event3]
-
Option 2:
settings: disabled_events: - event1 - event2 - event3
Default:
Undefined
whitelisted_events
allows you to set a list of events that should be included when updating the activity list.
This setting will take priority over the disabled_events
setting, even if the list is empty!
Please see the list of supported events for all the events you can disable.
The setting can be used in two ways:
-
option 1:
settings: whitelisted_events: [event1, event2, event3]
-
Option 2:
settings: whitelisted_events: - event1 - event2 - event3
The following list of events is supported for the disabled_events
and whitelisted_events
setting.
Type: | Disabled Actions: |
---|---|
comments |
Commenting on Issues |
create_repo |
Creating a new Repository |
fork |
Forking a Repository |
issues |
All Issues actions |
issues_open |
Opening Issues |
issues_close |
Closing Issues |
member |
Getting added as a Collaborator/Member |
pr |
All Pull request actions |
pr_open |
Opening a Pull request |
pr_merge |
Merging a Pull request |
pr_close |
Closing a Pull request |
push |
All commits performed |
release |
Publishing a new Release |
review |
Approving or requesting Changes in a Pull request |
star |
Starring a Repository |
wiki |
Creating a new Wiki page |
Default:
readme-bot
This setting allows you to change the name of the account that pushes the Readme Update.
Default:
41898282+github-actions[bot]@users.noreply.github.com
This setting allows you to change the e-mail of the account that pushes the Readme Update.
Default:
{REPO}{ID}
The url_text
option is used to set the text displayed when using the {URL}
placeholder.
Keep in mind that the text itself will be put into an embedded link ([:url_text](:url)
) and that {REPO}
and {ID}
will be turned into their respective values, but won't be turned into embedded links.
Default:
0
With the timezone
setting in the date
category can you set the timezone/time offset for the Date and time to be displayed.
The option can either be a positive or negative offset such as +01:00
or -01:00
, or it can be a Continent/City
format such as Europe/London
.
The difference between those two variants is, that the Continent/City
option respects special time changes such as daylight-saving time shifts.
A list of supported zones can be found on Wikipedia
Default:
Last updated: {DATE}
The text
option in date
allows you to set the text that should be displayed when the Activity list gets updated. The {DATE}
placeholder can be used to insert the date and time of when the List was updated. The format for that can be changed through the format
option mentioned below.
To display this text you will need to place a <!--RECENT_ACTIVITY:last_update-->
placeholder. The text will then be added below it.
Default:
dddd. mmmm dS, yyyy, h:MM:ss TT
With the format
option in date
can you define how the date and time should be displayed.
Supported are all options mentioned in the dateformat NPM package.
Note that the Z
cannot display the actual timezone such as CET
/CEST
but only timezones within the US (EST
/MDT
) or GMT
with the offset appended to it (i.e. GMT+0100
).
Default:
{NUM}.
The line_prefix
option is used to set the prefix for each line that shows activity.
The {NUM} placeholder is replaced by serial number for the activity line.
Default:
(empty list)
The ignored_repos
option is used to ignore certain repositories and hide them from the recent activity.
The setting can be used in two ways:
-
option 1:
settings: ignored_repos: [username1/repo1, username1/repo2, username2/repo3]
-
Option 2:
settings: whitelisted_events: - username1/repo1 - username1/repo2 - username2/repo3
Notes about Placeholders:
- Available Placeholders are:
{DATE}
,{ID}
,{FORK}
,{REPO}
,{URL}
,{AMOUNT}
,{WIKI}
and {NUM} - Each option only supports specific Placeholders which are mentioned in the
Supported Placeholders
section. - With the exception of
{AMOUNT}
,{DATE}
and{WIKI}
, all other placeholders will turn into embedded links (i.e.{ID}
becomes[#1](:url)
)-
{ID}
and{REPO}
can be used inurl_text
and won't be turned into embedded links there.{ID}
will still be prefixed with a#
-
The messages
section contains all the different messages you can set for the Activity-List to display.
added_member
changes_approved
changes_requested
comments
create_repo
fork_repo
issue_opened
issue_closed
new_release
new_star
pr_opened
pr_closed
pr_merged
push
wiki_create
Default:
🤝 Became collaborator on {REPO}
Supported Placeholders:
{REPO}
This text is displayed whenever you get added as a Member/Collaborator to a Repository.
Default:
👍 Approved {ID} in {REPO}
Supported Placeholders:
{ID}
{REPO}
{URL}
This text is displayed whenever you approve changes in a Pull request.
Default:
🔴 Requested {AMOUNT} change(s) in {ID} in {REPO}
Supported Placeholders:
{ID}
{REPO}
{AMOUNT}
{URL}
This text is displayed whenever you request changes to a Pull request.
The action will combine multiple Change requests for the same Pull request into one. The {AMOUNT}
placeholder can be used to display the amount of changes requested for a Pull request.
Default:
💬 Commented on {ID} in {REPO}
Supported Placeholders:
{ID}
{REPO}
{URL}
This text is displayed whenever you commented on an issue, Pull request (Includes default Review comments but not actual change requests or approvals) or commit.
Default:
📔 Created new repository {REPO}
Supported Placeholders:
{REPO}
This text is displayed whenever you create a new Repository.
Default:
🔱 Forked {FORK} from {REPO}
Supported Placeholders:
{FORK}
{REPO}
This text is displayed whenever you fork a Repository.
Default:
❗️ Opened issue {ID} in {REPO}
Supported Placeholders:
{ID}
{REPO}
{URL}
This text is displayed whenever you open a new Issue.
Default:
✔️ Closed issue {ID} in {REPO}
Supported Placeholders:
{ID}
{REPO}
{URL}
This text is displayed whenever you close an issue.
Default:
✌️ Released {ID} in {REPO}
Supported Placeholders:
{ID}
{REPO}
{URL}
This text is displayed whenever you create a new release. {ID}
will represent the Tag of the release.
Default:
⭐ Starred {REPO}
Supported Placeholders:
{REPO}
This text is displayed whenever you star a Repository.
Default:
💪 Opened PR {ID} in {REPO}
Supported Placeholders:
{ID}
{REPO}
{URL}
This text is displayed whenever you open a new Pull request.
Default:
❌ Closed PR {ID} in {REPO}
Supported Placeholders:
{ID}
{REPO}
{URL}
This text is displayed whenever you close a Pull request without merging it.
Default:
🎉 Merged PR {ID} in {REPO}
Supported Placeholders:
{ID}
{REPO}
{URL}
This text is displayed whenever you merge a Pull request.
Default:
⬆️ Pushed {AMOUNT} commit(s) to {REPO}
Supported Placeholders:
{AMOUNT}
{REPO}
This text is displayed whenever you make a commit to a repository.
{AMOUNT}
will display the amount of commits performed.
Default:
📖 Created new wiki page {WIKI} in {REPO}
Supported Placeholders:
{REPO}
{WIKI}
This text is displayed whenever you create a new Wiki page. {WIKI}
will be the name of the Wiki page created.
Copyright © 2021 Readme-Workflows Team and Contributors
Have ideas for the wiki? Let us know or PR it yourself!