Skip to content

Commit

Permalink
ci(pre-commit): add action-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tagoro9 committed Mar 19, 2024
1 parent ae28350 commit f9ff075
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ repos:
- id: actionlint
# actionlint doesn't like the uses: ./
exclude: ci.yaml
- repo: local
hooks:
- id: update-action-readme
name: update-action-readme
entry: ./script/update-action-readme
language: script
files: '.*/action\.yaml$'
14 changes: 14 additions & 0 deletions script/update-action-readme
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -e

for i in $*; do
# ignore if the file does not end with /action.yaml
if [[ "$i" != *"action.yaml" ]]; then
echo "skipping: ${i}"
continue
fi
readme_file=$(dirname "$i")/README.md
echo "npx action-docs --no-banner -s "${i}""
npx action-docs@2 --no-banner -s "${i}" -u "${readme_file}"
done

0 comments on commit f9ff075

Please sign in to comment.