diff --git a/Makefile b/Makefile index afcd0571..12e3a82a 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,7 @@ entry: target/docker-image.txt -e "INPUT_VERBOSE=true" \ -e "INPUT_PAGES=pages" \ -e "INPUT_TOKEN=00000000-0000-0000-0000-000000000000" \ + -e "INPUT_GITHUB_TOKEN=00000000-0000-0000-0000-000000000000" \ -e "INPUT_OPTIONS=$$(cat target/opts.txt)" \ "$${img}" echo "$$?" > target/entry.exit diff --git a/README.md b/README.md index 2a201a28..be88c5ad 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,8 @@ jobs: - uses: zerocracy/judges-action@0.0.55 with: token: ${{ secrets.ZEROCRACY_TOKEN }} - options: | - github_token=${{ secrets.GITHUB_TOKEN }} - repositories=... + github_token: ${{ secrets.GITHUB_TOKEN }} + repositories: yegor256/judges,yegor256/factbase,zerocracy/* factbase: foo.fb - uses: zerocracy/pages-action@0.0.40 with: @@ -78,6 +77,13 @@ The following options are expected by the plugin * `options` (mandatory) is a list of `k=v` pairs, which are explained below * `factbase` (mandatory) is the path of the [Factbase][factbase] file (where everything is kept) +* `repositories` (optional) is a comma-separated list of masks that + determine the repositories to manage, where + `yegor256/*` means all repos of the user, + `yegor256/judges` means a specific repo, + and + `-yegor256/judges` means an exclusion of the repo from the list. +* `github_token` (optional) is an authentication GitHub access token * `verbose` (optional) makes it print debugging info if set to `true` * `cycles` (optional) is a number of update cycles to run diff --git a/action.yml b/action.yml index 74c9efff..2fddada1 100644 --- a/action.yml +++ b/action.yml @@ -33,6 +33,12 @@ inputs: options: description: 'Command line options for the "judges" tool' required: false + repositories: + description: 'Comma-separated list of masks that determine the repositories to manage' + required: false + github_token: + description: 'Authentication GitHub access token' + required: false verbose: description: 'Log as much debug information as possible' required: false diff --git a/entry.sh b/entry.sh index 30d219cc..1040c5bb 100755 --- a/entry.sh +++ b/entry.sh @@ -83,6 +83,10 @@ GITHUB_REPO_NAME="${GITHUB_REPOSITORY#"${GITHUB_REPOSITORY_OWNER}/"}" VITALS_URL="https://${GITHUB_REPOSITORY_OWNER}.github.io/${GITHUB_REPO_NAME}/${name}-vitals.html" # Add new facts, using the judges (Ruby scripts) in the /judges directory +declare -A optionmap=( + ["repositories"]="${INPUT_REPOSITORIES}" + ["github_token"]="${INPUT_GITHUB_TOKEN}" +) declare -a options=() while IFS= read -r o; do s=$(echo "${o}" | xargs) @@ -93,8 +97,13 @@ while IFS= read -r o; do VITALS_URL="${v}" continue fi - options+=("--option=${k}=${v}") + optionmap[$k]=$v done <<< "${INPUT_OPTIONS}" +for k in "${!optionmap[@]}"; do + if [ -n "${optionmap[$k]}" ]; then + options+=("--option=${k}=${optionmap[$k]}"); + fi +done options+=("--option=judges_action_version=${VERSION}") options+=("--option=vitals_url=${VITALS_URL}")