Skip to content

Commit d1b6d58

Browse files
committed
modified: .github/actions/recent-posts/Dockerfile
- Changed CMD to ENTRYPOINT so the script could accept args. modified: .github/actions/recent-posts/action.yml - Added default path to README.md. modified: .github/actions/recent-posts/main.py - Removed default settings for `readme` and `num_entries` params. modified: .github/workflows/recent-posts.yml - Added `readme` arg.
1 parent 7b4535b commit d1b6d58

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

.github/actions/recent-posts/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ RUN pip install --no-cache-dir -r requirements.txt
55

66
COPY . ./
77

8-
CMD ["python", "/main.py"]
8+
ENTRYPOINT ["python", "/main.py"]

.github/actions/recent-posts/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ inputs:
55
readme:
66
description: "Path to the README.md"
77
required: false
8-
default: ./README.md
8+
default: "./README.md"
9+
910
num-entries:
1011
description: "Number of blog entries to show"
1112
required: false

.github/actions/recent-posts/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ def main(
4545
readme: Annotated[
4646
FilePath,
4747
Argument(help="Path to file where metadata will be written.")
48-
] = "README.md",
48+
],
4949
num_entries: Annotated[
5050
int,
5151
Argument(help="Number of blog entries to write to the `readme`.")
52-
] = 5
52+
],
5353
) -> None:
5454
"""Write most recent blog post metadata to ``readme``."""
5555
resp: Response = httpx.get(url=f"{BLOG_URL}/feed.xml")

.github/workflows/recent-posts.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ jobs:
1313
uses: actions/checkout@v4
1414

1515
- name: Recent post action
16-
# uses: "it176131/it176131.github.io/.github/actions/recent-posts@recent-posts"
17-
uses: "./.github/actions/recent-posts"
16+
uses: "it176131/it176131.github.io/.github/actions/recent-posts@recent-posts"
1817
with:
19-
readme: ./README.md
18+
readme: "./README.md"
2019
num-entries: 5
2120

2221
- name: Commit README
@@ -25,4 +24,4 @@ jobs:
2524
git config user.name github-actions
2625
git add README.md
2726
git commit -m "Synced and updated with most recent it176131.github.io blog post"
28-
# git push
27+
git push

0 commit comments

Comments
 (0)