From e0b8a6dd081c1f882578eb64ae16a11379163a50 Mon Sep 17 00:00:00 2001 From: Ryan Bright Date: Sat, 28 Nov 2026 14:35:09 -0700 Subject: [PATCH] ci(github): add the Repository checks workflow Gitleaks, markdownlint-cli2, and actionlint run in one job on pull requests and pushes to main. MD013 is off for the one-line README copy. The README table change is whitespace only. --- .github/workflows/repository-checks.yml | 76 +++++++++++++++++++++++++ .markdownlint-cli2.yaml | 5 ++ README.md | 18 +++--- 3 files changed, 90 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/repository-checks.yml create mode 100644 .markdownlint-cli2.yaml diff --git a/.github/workflows/repository-checks.yml b/.github/workflows/repository-checks.yml new file mode 100644 index 0000000..61faf7c --- /dev/null +++ b/.github/workflows/repository-checks.yml @@ -0,0 +1,76 @@ +name: Repository checks + +on: + pull_request: + branches: + - main + push: + branches: + - main + +permissions: + contents: read + +jobs: + checks: + name: Repository checks + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + persist-credentials: false + + # Each tool is a release binary, pinned by its version and SHA-256. + - name: Install Gitleaks and actionlint + env: + GITLEAKS_VERSION: 8.30.1 + GITLEAKS_SHA256: 551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb + ACTIONLINT_VERSION: 1.7.12 + ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8 + run: | + bin="$RUNNER_TEMP/bin" + mkdir -p "$bin" + cd "$RUNNER_TEMP" + + gitleaks_archive="gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" + curl -fsSLO "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/${gitleaks_archive}" + echo "${GITLEAKS_SHA256} ${gitleaks_archive}" | sha256sum --check + tar -xzf "$gitleaks_archive" -C "$bin" gitleaks + + actionlint_archive="actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" + curl -fsSLO "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/${actionlint_archive}" + echo "${ACTIONLINT_SHA256} ${actionlint_archive}" | sha256sum --check + tar -xzf "$actionlint_archive" -C "$bin" actionlint + + echo "$bin" >> "$GITHUB_PATH" + + # A pull request scans its own commits (base..head), and a push to main + # scans the pushed commits (before..after). When the base commit is not + # in the clone (a zero SHA for a new branch, or a force push), the scan + # reads the full history that the head reaches. + - name: Gitleaks + env: + GITLEAKS_BASE: ${{ github.event.pull_request.base.sha || github.event.before }} + GITLEAKS_HEAD: ${{ github.event.pull_request.head.sha || github.event.after }} + run: | + log_opts="$GITLEAKS_BASE..$GITLEAKS_HEAD" + if ! git cat-file -e "$GITLEAKS_BASE^{commit}" 2>/dev/null; then + log_opts="$GITLEAKS_HEAD" + fi + echo "Gitleaks: --log-opts=$log_opts" + + # The repository is public, so --redact keeps each secret out of the log. + gitleaks git --no-banner --redact --verbose --log-opts="$log_opts" . + + - name: Markdown lint + uses: DavidAnson/markdownlint-cli2-action@3ce8f712b5d8f31acd8e201be6d97e3d2bb23eb7 # v25.1.0 + with: + globs: '**/*.md' + + - name: actionlint + run: actionlint diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 0000000..4ebcb22 --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,5 @@ +# README.md is customer-facing copy that keeps each paragraph on one line, +# and a table row cannot wrap. Wrapping the copy would edit text that this +# repository does not own, so line length is not checked. +config: + MD013: false diff --git a/README.md b/README.md index f425d71..5ea8b40 100644 --- a/README.md +++ b/README.md @@ -53,15 +53,15 @@ The code expires after 5 minutes. The CLI keeps its refresh token in the credent ## Commands -| Command | Result | -| -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `agentgolf login` | Sign in and save the login. | -| `agentgolf logout` | Remove the saved login. | -| `agentgolf harness setup ` | Create a personal publishing key and write the settings of the harness. | -| `agentgolf attribute ` | Link one agent session to one GitHub pull request. | -| `agentgolf attribution evidence --session ` | Show the attribution records of one session. | -| `agentgolf attribution evidence --pull-request ` | Show the attribution records of one pull request. | -| `agentgolf attribution repositories` | List the repositories that attribution covers in your workspace. | +| Command | Result | +| -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `agentgolf login` | Sign in and save the login. | +| `agentgolf logout` | Remove the saved login. | +| `agentgolf harness setup ` | Create a personal publishing key and write the settings of the harness. | +| `agentgolf attribute ` | Link one agent session to one GitHub pull request. | +| `agentgolf attribution evidence --session ` | Show the attribution records of one session. | +| `agentgolf attribution evidence --pull-request ` | Show the attribution records of one pull request. | +| `agentgolf attribution repositories` | List the repositories that attribution covers in your workspace. | | `agentgolf attribution audit --since