I've created a GitHub Action for building Anki cards from Markdown files, and I'm using the "composite" type in my action.yml. However, when I run this action in another repository, it's not working because it doesn't have its own action files.
Here's my action.yml:
name: 'anki-action'
description: 'Build anki cards from .md files'
branding:
icon: alert-triangle
color: orange
runs:
using: 'composite'
steps:
- run: ls -la
shell: bash
- run: ${{ github.action_path }}/entry.sh ${{ inputs.path }}
shell: bash
- uses: actions/upload-artifact@v2
with:
name: anki-cards
path: /home/runner/work/anki-action/anki-action/anki-cards/cards.apkg
inputs:
path:
description: 'The directory with .md files'
required: false
default: 'anki-cards'
And here's my entry.sh:
set -e
set -x
input_path="${1:-anki-cards}"
cd ${GITHUB_WORKSPACE-/w}
npm i
cd $input_path
ls -la
for filename in $(ls .)
do
../node_modules/mdanki/src/index.js $filename cards.apkg
done
I've tried to build Anki cards for LeetCode in this action, but it's not working as expected.
Any help or guidance on how to make this "composite" GitHub Action work in other repositories would be greatly appreciated.
Thank you!
Workflow:
Composite action:
Useful links: