-
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.
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@v2.3.4
- uses: Readme-Workflows/recent-activity@v2.0.0
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.
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:
[comments]
With the disabled_events
option can you set a list of events that the Action should ignore when creating the Activity-list.
There are two valid ways to set names for disabling:
-
option 1:
settings: disabled_events: [event1, event2, event3]
-
Option 2:
settings: disabled_events: - event1 - event2 - event3
You can currently set the following values:
Type: | Disabled Actions: |
---|---|
comments |
Commenting on Issues, Pull requests or Commits |
create_repo |
Creating a new Repository |
fork |
Forking a Repository |
issues |
Opening or closing Issues |
member |
Getting added as a Collaborator/Member |
pr |
Opening, closing or Merging a Pull request |
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:
{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 will you 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
).
The messages
section contains all the different messages you can set for the Activity-List to display.
Notes about Placeholders:
- Available Placeholders are:
{DATE}
,{ID}
,{FORK}
,{REPO}
,{URL}
and{WIKI}
- Each option only supports specific Placeholders which are mentioned in the
Supported Placeholders
section. - With the exception of
{DATE}
and{WIKI}
will all placeholders be turned 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.{ID}
will still be prefixed with a#
-
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:
❗️ 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:
💪 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:
📔 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:
📖 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.
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 changes in {ID} in {REPO}
Supported Placeholders:
{ID}
{REPO}
{URL}
This text is displayed whenever you request changes to a Pull request.
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.
Copyright © 2021 Readme-Workflows Team and Contributors
Have ideas for the wiki? Let us know or PR it yourself!