Skip to content

Commit

Permalink
Merge branch 'master' into release/v1
Browse files Browse the repository at this point in the history
  • Loading branch information
sarisia committed Aug 15, 2020
2 parents 50f5cd1 + 66e8cfa commit 871eed3
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 9 deletions.
42 changes: 35 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Actions Doc Feed
# Actions Readme Feed

Add latest entries from RSS feed to your document.
Display RSS feed in your [GitHub Profile README](https://docs.github.com/en/github/setting-up-and-managing-your-github-profile/managing-your-profile-readme)

![](https://user-images.githubusercontent.com/33576079/90322554-a6815580-df90-11ea-8a16-96327dfdb0ea.png)

# Usage

First, add flag comments to anywhere you want in your document:
First, add flag comments to where you want in your document:

```markdown
### Latest Posts
Expand All @@ -17,7 +19,7 @@ Then add following steps to your workflow:
```yaml
steps:
- uses: actions/checkout@v2
- uses: sarisia/actions-doc-feed@v1
- uses: sarisia/actions-readme-feed@v1
with:
url: 'https://note.sarisia.cc/index.xml'
file: 'README.md'
Expand Down Expand Up @@ -89,12 +91,38 @@ You can padding variables with zeros or spaces.

# Examples

## Automatically update GitHub Profile README

Make your workflow with `schedule` trigger.

```yaml
on:
schedule:
- cron: '0 */6 * * *'

jobs:
readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: sarisia/actions-readme-feed@v1
with:
url: 'https://note.sarisia.cc/index.xml'
file: 'README.md'
- run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git add .
git commit -m "docs: update feed" || true
git push
```

## Qiita

Not only Qiita, you can use any RSS feeds that [`rss-parser`](https://github.com/rbren/rss-parser) supports.

```yaml
- uses: sarisia/actions-doc-feed@v1
- uses: sarisia/actions-readme-feed@v1
with:
url: 'https://qiita.com/sarisia/feed'
file: 'README.md'
Expand All @@ -112,14 +140,14 @@ Make sure to change `start_flag` and `end_flag` for each feed.

```yaml
- name: blog
uses: sarisia/actions-doc-feed@v1
uses: sarisia/actions-readme-feed@v1
with:
url: 'https://note.sarisia.cc/index.xml'
file: 'README.md'
start_flag: "<!-- blog start -->"
end_flag: "<!-- blog end -->"
- name: qiita
uses: sarisia/actions-doc-feed@v1
uses: sarisia/actions-readme-feed@v1
with:
url: 'https://qiita.com/sarisia/feed'
file: 'README.md'
Expand Down
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Actions Doc Feed'
description: 'Update Your Document with RSS Feed'
name: 'Actions Readme Feed'
description: 'Display RSS feed in your GitHub Profile README'
author: Sarisia

inputs:
Expand All @@ -12,15 +12,19 @@ inputs:
max_entry:
description: 'Number of entries to show'
required: false
default: 5
format:
description: 'Feed format string'
required: false
default: '- ${monthshort} ${02day} - [${title}](${url})'
start_flag:
description: 'Start of feed block in Markdown'
required: false
default: '<!-- feed start -->'
end_flag:
description: 'End of feed block in Markdown'
required: false
default: '<!-- feed end -->'

runs:
using: 'node12'
Expand Down

0 comments on commit 871eed3

Please sign in to comment.