diff --git a/.ci-scripts/update-toc.sh b/.ci-scripts/update-toc.sh new file mode 100755 index 0000000..85e034d --- /dev/null +++ b/.ci-scripts/update-toc.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Enable debug - print commands +#set -x + +function generateToc() { + echo "* TODO" + return +# while read -r file; do +# adrNumber=$(cut -d- -f1 <<<"$file") +# adrTitle=$(sed '/---/,/---/d' "$file" | sed -En 's/^# (.+)$/\1/p' | head -1) +# 1>&2 echo " - $file => ($adrNumber) $adrTitle" +# printf -- "* [ADR-%s](%s) - %s\n" "$adrNumber" "$file" "$adrTitle" +# done < <(find . -maxdepth 1 -type f -regex '\./[0-9]+-.*\.md' -exec basename {} \; | sort) +} + +echo "Generating TOC in README.md" +# https://stackoverflow.com/questions/2699666/replace-delimited-block-of-text-in-file-with-the-contents-of-another-file +sed -i -ne '// {p; r '<(generateToc) -e ':a; n; // {p; b}; ba}; p' README.md diff --git a/.github/workflows/create-aliases.yml b/.github/workflows/create-aliases.yml index 945e604..bc2537a 100644 --- a/.github/workflows/create-aliases.yml +++ b/.github/workflows/create-aliases.yml @@ -22,11 +22,13 @@ jobs: run: .ci-scripts/parse-formulas.sh - name: Generate Aliases run: .ci-scripts/generate-aliases.sh + - name: Update TOC + run: .ci-scripts/update-toc.sh - name: Commit & Push changes run: | git config --global user.name 'QAware Homebrew Bot' git config --global user.email 'qaware.homebrew.bot@qaware.de' - git add Aliases + git add Aliases README.md git commit --quiet -m "chore: update Aliases" || { echo "Nothing to commit or commit failed, will exit now" exit 0 diff --git a/README.md b/README.md index 7b09248..b178d03 100644 --- a/README.md +++ b/README.md @@ -22,5 +22,17 @@ brew install protocurl brew install qaware/tap/protocurl ``` - - +## Content + + + + +## Formulae maintainer + +If you want to push your own `Formulae` these are the steps: + +* Get a `Deploy Token` for your repo/CI (can be requested by the maintainers of this tap-repo) + +## Maintainers + +* Alexander Eimer (@qa-alexander-eimer)