From 2007acc9ec0b391573b752b825facd11821c848c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 26 Apr 2026 04:41:00 +0000 Subject: [PATCH 1/2] Initial plan From 3e8c561e3559764013cdea31c934b97b021036e9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 26 Apr 2026 04:47:12 +0000 Subject: [PATCH 2/2] docs: strengthen skip-if-match guidance for scheduled issue-creating workflows Agent-Logs-Url: https://github.com/github/gh-aw/sessions/125c4a56-30b2-49be-8ade-e163c076698d Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/aw/create-agentic-workflow.md | 10 ++++++++++ .github/aw/github-agentic-workflows.md | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/aw/create-agentic-workflow.md b/.github/aw/create-agentic-workflow.md index 3efb3829729..8b9b2327732 100644 --- a/.github/aw/create-agentic-workflow.md +++ b/.github/aw/create-agentic-workflow.md @@ -828,6 +828,16 @@ Based on the parsed requirements, determine: - **No action needed** → `safe-outputs: noop:` - **IMPORTANT**: When the agent successfully completes but determines nothing needs to be done, use `noop` to signal completion. This is critical for transparency—it shows the agent worked AND that no output was necessary. - **Daily reporting workflows** (creates issues/discussions): Add `close-older-issues: true` or `close-older-discussions: true` to prevent clutter - **Daily improver workflows** (creates PRs): Add `skip-if-match:` with a filter to avoid opening duplicate PRs (e.g., `'is:pr is:open in:title "[workflow-name]"'`) + - **Scheduled workflows that create issues**: Add `skip-if-match:` to avoid creating duplicate issues on every run. Pair with `expires:` so resolved issues are cleaned up automatically. Example: + ```yaml + on: + skip-if-match: 'is:issue is:open in:title "[workflow-name]"' + safe-outputs: + create-issue: + title-prefix: "[workflow-name] " + expires: 7 # auto-close after 7 days + ``` + Without `skip-if-match`, a scheduled workflow that creates issues will open a new issue on every run even if an identical issue is already open. - **New workflows** (when creating, not updating): Consider enabling `missing-tool: create-issue: true` to automatically track missing tools as GitHub issues that expire after 1 week 5. **Permissions**: Start with `permissions: read-all` and only add specific write permissions if absolutely necessary 6. **Repository Access Roles**: Consider who should be able to trigger the workflow: diff --git a/.github/aw/github-agentic-workflows.md b/.github/aw/github-agentic-workflows.md index 3187d51d602..905b323617a 100644 --- a/.github/aw/github-agentic-workflows.md +++ b/.github/aw/github-agentic-workflows.md @@ -610,6 +610,20 @@ The YAML frontmatter supports these fields: **Auto-Expiration**: The `expires` field auto-closes issues after a time period. Supports integers (days) or relative formats (2h, 7d, 2w, 1m, 1y). Generates `agentics-maintenance.yml` workflow that runs at minimum required frequency based on shortest expiration time: 1 day or less → every 2 hours, 2 days → every 6 hours, 3-4 days → every 12 hours, 5+ days → daily. When using `safe-outputs.create-issue`, the main job does **not** need `issues: write` permission since issue creation is handled by a separate job with appropriate permissions. + **Deduplication for Scheduled Workflows**: When a `schedule:` trigger is combined with `create-issue`, use `skip-if-match:` in the `on:` block to prevent opening a duplicate issue on every run. Pair with `expires:` so stale issues are cleaned up automatically: + + ```yaml + on: + schedule: daily on weekdays + skip-if-match: 'is:issue is:open in:title "[my-workflow] "' + safe-outputs: + create-issue: + title-prefix: "[my-workflow] " + expires: 7 # auto-close after 7 days + ``` + + Without `skip-if-match`, the workflow creates a new issue on every scheduled run even when an identical open issue already exists. + **Temporary IDs and Sub-Issues:** When creating multiple issues, use `temporary_id` (format: `aw_` + 3-8 alphanumeric chars) to reference parent issues before creation. References like `#aw_abc123` in issue bodies are automatically replaced with actual issue numbers. Use the `parent` field to create sub-issue relationships: