Skip to content

Github

jobs:
printJob:
name: Print event
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
Terminal window
gh api /repos/OWNER/REPO/environments | jq '.environments[].name'
# To neatly formatted table e.g.
gh api repos/OWNER/REPO/environments | jq -r '(["ID", "Name", "Prevent-Self-review"] | (., map(length*"-"))), (.environments[] | [.id, .name, .protection_rules[]?.prevent_self_review]) | @tsv' | column -t