Skip to content

Offer quick setup script #140

Closed
Closed

Description

@strawgate

Let's offer a quick setup script which creates the right GitHub pat, creates a secret in the repo, makes a branch, adds our recommended gh-aw workflows, pushes the branch and makes a PR

It's okay for it to require the gh cli

Activity

  1. github-actions commented on Feb 19, 2026

    @github-actions
    Contributor

    tl;dr: Add a scripts/quick-setup.sh that uses gh to mint/refresh a token, set COPILOT_GITHUB_TOKEN, fetch recommended gh-agent-workflows/*/example.yml (plus agentics-maintenance.yml), then push a branch and open a PR; document it in README and gh-agent-workflows/README.md.

    Recommendation

    • Implement a single-shot setup script (using gh) that creates a branch, installs a curated set of workflow trigger files, sets the COPILOT_GITHUB_TOKEN secret, and opens a PR. Default to the caller-based install path (download example.yml files) and include agentics-maintenance.yml up front.
    Findings

    The caller-based install path already expects example.yml triggers and the COPILOT_GITHUB_TOKEN secret:

    `gh-agent-workflows/README.md:32-48`
    32: # .github/workflows/pr-review.yml
    33: name: PR Review
    34: on:
    35:   pull_request:
    36:     types: [opened, synchronize, reopened, ready_for_review]
    37: jobs:
    38:   run:
    39:     uses: elastic/ai-github-actions/.github/workflows/gh-aw-pr-review.lock.yml@v0
    40:     with:
    41:       setup-commands: |
    42:         pip install -e ".[dev]"
    43:       additional-instructions: |
    44:         Focus on Python best practices and type safety.
    45:     secrets:
    46:       COPILOT_GITHUB_TOKEN: $\{\{ secrets.COPILOT_GITHUB_TOKEN }}

    Classic install (gh-aw) exists but is optional; a quick setup script can stay on the caller-based path:

    `gh-agent-workflows/README.md:101-111`
    101: # Install a workflow (classic install pulls the workflow .md from this repo)
    102: gh aw add elastic/ai-github-actions/gh-agent-workflows/pr-review.md
    103:
    104: # Compile to generate the lock file
    105: gh aw compile
    106:
    107: # Commit both files and push
    108: git add .github/workflows/gh-aw-pr-review.md .github/workflows/gh-aw-pr-review.lock.yml
    109: git commit -m "Add PR review workflow"
    110: git push

    Some workflows require agentics-maintenance; the quick setup can always install it:

    `gh-agent-workflows/README.md:56-62`
    56: Any workflow that uses safe-outputs with `expires` (create-issue, create-pull-request, create-discussion) requires the `agentics-maintenance` workflow so expired items are closed automatically. Install it once per repo:
    57: 
    58: mkdir -p .github/workflows && curl -sL \
    59:   https://raw.githubusercontent.com/elastic/ai-github-actions/v0/.github/workflows/agentics-maintenance.yml \
    60:   -o .github/workflows/agentics-maintenance.yml
    Verification

    No tests run (triage only).

    Detailed Action Plan
    1. Add scripts/quick-setup.sh (new file) that:
      • Requires gh + gh auth status and accepts --repo and --branch (e.g., --branch ai-gh-aw-setup).
      • Uses gh auth refresh -s repo,workflow (or prompts for a token) and pipes the result into gh secret set COPILOT_GITHUB_TOKEN --body (do not echo).
      • Creates .github/workflows/, downloads a default workflow set from gh-agent-workflows/(name)/example.yml, and writes them into .github/workflows/ (rename as needed).
      • Downloads agentics-maintenance.yml (see gh-agent-workflows/README.md:56-62) to cover expiring safe-outputs.
      • Commits, pushes, and opens a PR via gh pr create --fill.
    2. Document the script in the repo’s top-level Quick Start (place near README.md:5-52) and in the agentic workflow Quick Start (near gh-agent-workflows/README.md:28-52) with a minimal usage example and the default workflow list.
    3. Optionally add flags (--workflows, --skip-secret, --dry-run) to keep the script safe and reusable.
    Related Items
    Type Link Relevance
    Issue #140 Current request
    File gh-agent-workflows/README.md:28-112 Quick Start + classic install steps to automate
    File README.md:5-52 Repo-level Quick Start to link the script

    What is this? | From workflow: Issue Triage Agent

    Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. for issue #140

  2. strawgate commented on Feb 19, 2026

    @strawgate
    ContributorAuthor

    /ai make a pr

  3. strawgate commented on Feb 19, 2026

    @strawgate
    ContributorAuthor

    /ai make a pr

  4. github-actions commented on Feb 19, 2026

    @github-actions
    Contributor

    Summary:

    • added scripts/quick-setup.sh to install recommended trigger workflows, add agentics-maintenance.yml, set COPILOT_GITHUB_TOKEN, and open a PR
    • documented the quick setup script in README.md and gh-agent-workflows/README.md

    Testing:

    • make lint

    PR opened: "Add quick setup script for gh-aw workflows".


    What is this? | From workflow: Issue Assistant

    Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. for issue #140

  5. strawgate commented on Feb 19, 2026

    @strawgate
    ContributorAuthor

    /ai make a new pr please

  6. strawgate commented on Feb 19, 2026

    @strawgate
    ContributorAuthor

    /ai make a new pr please

  7. github-actions commented on Feb 19, 2026

    @github-actions
    Contributor

    Implemented and opened a new PR for this issue.

    What changed

    • Added scripts/quick-setup.sh to bootstrap a target repo with recommended gh-aw workflows.
    • The script now:
      • downloads recommended gh-agent-workflows/*/example.yml files into .github/workflows/trigger-*.yml
      • adds .github/workflows/agentics-maintenance.yml
      • sets COPILOT_GITHUB_TOKEN (from COPILOT_GITHUB_TOKEN env var, or via gh auth refresh -s copilot-requests + gh auth token)
      • creates/uses a setup branch, commits, pushes, and opens a PR
    • Documented usage in:
      • README.md
      • gh-agent-workflows/README.md

    Validation

    • Ran make lint successfully.

    What is this? | From workflow: Issue Assistant

    Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. for issue #140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions