diff --git a/README.md b/README.md index f69962d..8934117 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ jobs: ## Prerequisites +### Team and Authentication + 1. Create a GitHub team and add at least one member 2. Authentication options: - GitHub App @@ -62,6 +64,13 @@ Notes: - A Personal Access Token (PAT) is not used since we want the comment to show as from a bot - The `github.token` is not used since the token can't provide hyperlinks for @ mentions since it doesn't have the scope for org teams, only repository data +### Runner Software Requirements + +Required software installed on runner: + + - [`gh` (GitHub CLI)](https://cli.github.com/) + - [`jq`](https://jqlang.github.io/jq/download/) + ## Breaking Changes ### v1 to v2 diff --git a/action.yml b/action.yml index c825c57..f39ca7c 100644 --- a/action.yml +++ b/action.yml @@ -45,6 +45,15 @@ runs: shell: bash run: | # "checking for a ${{ inputs.approve-command }} command in the comments from someone in the ${{ inputs.team-name}} team" + + # prerequisite check + for cmd in gh jq; do + if ! command -v $cmd &> /dev/null; then + echo "::error title=${cmd} not installed::Could not find \`${cmd}\` on the runner" + exit 1 + fi + done + # getting team membership" echo "getting team membership for the team: @${{ github.repository_owner }}/${{ inputs.team-name }} ..." users=$(gh api --paginate '${{ github.event.organization.url }}/teams/${{ inputs.team-name }}/members' --jq '.[].login')