elastic / elastic/ai-github-actions

[product-manager-impersonator] Quick setup existing-file safety mode

Open
#888 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
11
Forks
16
Avg merge
22h 9m
Merged PRs (30d)
31

Description

## Feature Idea

**Summary:** Add an `--existing-file-policy` option to `scripts/quick-setup.sh` so reruns can `skip`, `error`, or `overwrite` when target workflow files already exist.

## Why a Customer Would Want This
Teams often install workflows, then customize the generated `trigger-*.yml` files for their repo. Later, they rerun quick setup to add another workflow or refresh defaults. Today that rerun can silently overwrite customized files, which creates avoidable breakage and reduces trust in the setup flow.

## Rough Implementation Sketch
- Add a new flag in `scripts/quick-setup.sh` (for example: `--existing-file-policy skip|error|overwrite`) with `overwrite` as the current-behavior default.
- Before each download to `.github/workflows/trigger-*.yml` and `agentics-maintenance.yml`, check `-f "$dest"` and apply the selected policy.
- Include clear stdout/stderr summary counts for created, skipped, and conflicted files so users understand what changed.
- Document the new option in script usage text and docs where quick setup is recommended.

## Why It Won't Be That Hard
This is a narrow, local change in one Bash script plus small docs updates. The script already centralizes destination paths and download behavior, so policy handling can be added in a single loop without touching workflow compiler logic.

## Evidence
- `scripts/quick-setup.sh:194-203` currently downloads each trigger file with `curl -o` unconditionally, which overwrites existing files.
- `scripts/quick-setup.sh:206-213` does the same for `.github/workflows/agentics-maintenance.yml`.
- `docs/workflows/gh-agent-workflows.md:7` tells users to copy `example.yml` and customize inputs.
- `docs/workflows/gh-agent-workflows.md:195` reiterates that consumer repos customize copied trigger files, making overwrite safety important on reruns.
- Existing PM issues cover adjacent setup ideas (preflight/postflight/listing/presets), but not file-overwrite policy for idempotent reruns.

> [!NOTE]
>
> 🔒 Integrity filter blocked 2 items
>
> The following items were blocked because they don't meet the GitHub integrity level.
>
> - [#424](https://github.com/elastic/ai-github-actions/issues/424) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#704](https://github.com/elastic/ai-github-actions/issues/704) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
>
> To allow these resources, lower `min-integrity` in your GitHub frontmatter:
>
> ```yaml
> tools:
> github:
> min-integrity: approved # merged | approved | unapproved | none
> ```
>
>

---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Trigger Product Manager Impersonator](https://github.com/elastic/ai-github-actions/actions/runs/24076478940)

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.