Skip to content

Commit

Permalink
modified: .github/actions/recent-posts/Dockerfile
Browse files Browse the repository at this point in the history
	- 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.
  • Loading branch information
it176131 committed Jan 5, 2025
1 parent 7b4535b commit d1b6d58
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/actions/recent-posts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ RUN pip install --no-cache-dir -r requirements.txt

COPY . ./

CMD ["python", "/main.py"]
ENTRYPOINT ["python", "/main.py"]
3 changes: 2 additions & 1 deletion .github/actions/recent-posts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ inputs:
readme:
description: "Path to the README.md"
required: false
default: ./README.md
default: "./README.md"

num-entries:
description: "Number of blog entries to show"
required: false
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/recent-posts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def main(
readme: Annotated[
FilePath,
Argument(help="Path to file where metadata will be written.")
] = "README.md",
],
num_entries: Annotated[
int,
Argument(help="Number of blog entries to write to the `readme`.")
] = 5
],
) -> None:
"""Write most recent blog post metadata to ``readme``."""
resp: Response = httpx.get(url=f"{BLOG_URL}/feed.xml")
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/recent-posts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ jobs:
uses: actions/checkout@v4

- name: Recent post action
# uses: "it176131/it176131.github.io/.github/actions/recent-posts@recent-posts"
uses: "./.github/actions/recent-posts"
uses: "it176131/it176131.github.io/.github/actions/recent-posts@recent-posts"
with:
readme: ./README.md
readme: "./README.md"
num-entries: 5

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

0 comments on commit d1b6d58

Please sign in to comment.