Skip to content

Commit

Permalink
Adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
katydecorah committed Jun 17, 2024
1 parent 849b8b3 commit ae5c165
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/scheduled-advanced.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Seasonal scheduled post

on:
workflow_dispatch:
schedule:
- cron: "31 0 17 Mar,Jun,Sep,Dec *"
- cron: "0 1 20 Mar,Jun,Sep,Dec *"

jobs:
scheduled-post:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Scheduled post action

A GitHub action that creates a scheduled post from data files generated by [read-action](https://github.com/katydecorah/read-action), [bookmark-action](https://github.com/katydecorah/bookmark-action), and [spotify-to-yaml-action](https://github.com/katydecorah/spotify-to-yaml-action).
A GitHub action that creates a scheduled post from data files generated by [read-action](https://github.com/library-pals/read-action), [bookmark-action](https://github.com/library-pals/bookmark-action), and [spotify-to-yaml-action](https://github.com/library-pals/spotify-to-yaml-action).

If you're including playlist data generated by the spotify-to-yaml-action, you'll want to make sure it's schedule to run before this action.
If you're including playlist data generated by the spotify-to-yaml-action, make sure it's schedule to run before this action.

<!-- START GENERATED DOCUMENTATION -->

Expand Down
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,12 @@ inputs:

book-tags:
description: "Allow specific tags to be passed through. Separate each tag with a comma."

start-date:
description: "The start date for the post. The format is `YYYY-MM-DD`."

end-date:
description: "The end date for the post. The format is `YYYY-MM-DD`."

post-title:
description: "The title of the post."
4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51008,7 +51008,9 @@ function action() {
return action_awaiter(this, void 0, void 0, function* () {
try {
const payload = github.context.payload.inputs;
const { "post-title": title, "start-date": startDate, "end-date": endDate, } = payload;
const title = (payload === null || payload === void 0 ? void 0 : payload["post-title"]) || (0,core.getInput)("post-title");
const startDate = (payload === null || payload === void 0 ? void 0 : payload["start-date"]) || (0,core.getInput)("start-date");
const endDate = (payload === null || payload === void 0 ? void 0 : payload["end-date"]) || (0,core.getInput)("end-date");
validateInputs(title, startDate, endDate);
const slugifyTitle = title.toLowerCase().replace(/\s/g, "-");
const image = `${slugifyTitle}.png`;
Expand Down
9 changes: 4 additions & 5 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import * as github from "@actions/github";
export async function action() {
try {
const payload = github.context.payload.inputs;
const {
"post-title": title,
"start-date": startDate,
"end-date": endDate,
} = payload;

const title = payload?.["post-title"] || getInput("post-title");
const startDate = payload?.["start-date"] || getInput("start-date");
const endDate = payload?.["end-date"] || getInput("end-date");

validateInputs(title, startDate, endDate);

Expand Down

0 comments on commit ae5c165

Please sign in to comment.