2024-04-13 21:07:22 +00:00
|
|
|
name: "Markdown to Gempost"
|
|
|
|
|
2024-04-13 20:11:41 +00:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
2024-04-13 23:36:25 +00:00
|
|
|
- 'markdown/incoming/**'
|
2024-04-13 20:11:41 +00:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: md2gmi
|
2024-04-14 01:54:29 +00:00
|
|
|
cancel-in-progress: false
|
2024-04-13 20:11:41 +00:00
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
2024-04-14 01:54:29 +00:00
|
|
|
setup:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
work_to_do: ${{ steps.check_markdown.outputs.work_to_do }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.MY_GH_TOKEN }}
|
|
|
|
- name: Check for files to be processed
|
|
|
|
id: check_markdown
|
|
|
|
run: |
|
|
|
|
mapfile -t md_files < <(find markdown/incoming -type f -name "*.md")
|
|
|
|
if [ ${#md_files[@]} -eq 0 ]; then
|
|
|
|
echo "No Markdown files to process, exiting early."
|
|
|
|
echo "work_to_do=false" >> $GITHUB_OUTPUT
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo "work_to_do=true" >> $GITHUB_OUTPUT
|
|
|
|
fi
|
|
|
|
|
2024-04-13 20:11:41 +00:00
|
|
|
md2gmi:
|
2024-04-14 01:54:29 +00:00
|
|
|
needs: setup
|
|
|
|
if: needs.setup.outputs.work_to_do == 'true'
|
2024-04-13 20:11:41 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-04-13 21:45:03 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.MY_GH_TOKEN }}
|
2024-04-13 20:11:41 +00:00
|
|
|
- uses: ./.github/actions/markdown2gempost
|
|
|
|
with:
|
2024-04-13 21:07:22 +00:00
|
|
|
input-dir: 'markdown/incoming'
|
2024-04-13 20:11:41 +00:00
|
|
|
output-dir: 'gemlog'
|
2024-04-13 21:07:22 +00:00
|
|
|
processed-dir: 'markdown'
|
2024-04-13 20:11:41 +00:00
|
|
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
|
|
|
with:
|
|
|
|
commit_message: 'convert Markdown post to Gempost'
|