Check Scheduled Posts #23593
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Scheduled Posts | |
on: | |
schedule: | |
- cron: "0 * * * *" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Execute check for scheduled posts | |
shell: bash | |
id: schedule-check | |
run: | | |
chmod +x detectScheduledPosts.sh | |
./detectScheduledPosts.sh | |
if [ $? -eq 42 ]; then | |
echo 'There is an scheduled post! Will publish the blog...' | |
echo '::set-output name=EXECUTE_WORKFLOW::true' | |
else | |
echo 'No scheduled posts detected...' | |
fi | |
- uses: convictional/trigger-workflow-and-wait@master | |
if: ${{ steps.schedule-check.outputs.EXECUTE_WORKFLOW == 'true' }} | |
with: | |
owner: piraces | |
repo: blog | |
github_token: ${{ secrets.PAT }} |