Skip to content

Commit ac0066e

Browse files
authored
Added code simplification workflows for GH (#26419)
## Description [GitHub Agentic Workflows (GH AW)](https://github.github.com/gh-aw/introduction/overview/) are AI powered workflows that leverage tools available in GitHub to create automated workflows. This PR is a POC of sorts where I wish to test the GH AW workflows for [code simplication](https://github.github.com/gh-aw/blog/2026-01-13-meet-the-workflows-continuous-simplicity/). These two workflows do the following: 1) Code simpification: The first workflow looks at PRs over the past 24 hours and creates PRs to "simplify" code. The only available `safe_output` for this flow is PR generation (if the model decides simplification is needed). 2) Code de-dupe: The second workflows looks at existing code and PRs to de-dupe code across the repo. If a de-dupe oppurtunity exists, the model creates an issue in the Microsoft/FluidFramework repo. **These flows are currently for testing and DO NOT have any intrusive elevated permissions. They only have the least privilege to perform the needed tasks.** ## Breaking Changes There are no breaking changes. ## Reviewer Guidance Happy to get reviews on any changes to prompts, validation flows etc.
1 parent f2dfca1 commit ac0066e

9 files changed

Lines changed: 2950 additions & 0 deletions

File tree

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ fence.json linguist-language=JSON5
2020

2121
# Hide docs from GitHub's language detection
2222
/docs/** linguist-documentation
23+
24+
.github/workflows/*.lock.yml linguist-generated=true merge=ours

.github/aw/actions-lock.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"entries": {
3+
"actions/github-script@v8": {
4+
"repo": "actions/github-script",
5+
"version": "v8",
6+
"sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd"
7+
},
8+
"github/gh-aw/actions/setup@v0.42.17": {
9+
"repo": "github/gh-aw/actions/setup",
10+
"version": "v0.42.17",
11+
"sha": "7a970851c1090295e55a16e549c61ba1ce227f16"
12+
}
13+
}
14+
}

.github/aw/imports/.gitattributes

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/aw/imports/github/gh-aw/94662b1dee8ce96c876ba9f33b3ab8be32de82a4/.github_workflows_shared_reporting.md

Lines changed: 73 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#
2+
# ___ _ _
3+
# / _ \ | | (_)
4+
# | |_| | __ _ ___ _ __ | |_ _ ___
5+
# | _ |/ _` |/ _ \ '_ \| __| |/ __|
6+
# | | | | (_| | __/ | | | |_| | (__
7+
# \_| |_/\__, |\___|_| |_|\__|_|\___|
8+
# __/ |
9+
# _ _ |___/
10+
# | | | | / _| |
11+
# | | | | ___ _ __ _ __| |_| | _____ ____
12+
# | |/\| |/ _ \ '__| |/ /| _| |/ _ \ \ /\ / / ___|
13+
# \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \
14+
# \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/
15+
#
16+
# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.42.17). DO NOT EDIT.
17+
#
18+
# To regenerate this workflow, run:
19+
# gh aw compile
20+
# For more information: https://github.com/github/gh-aw/blob/main/.github/aw/github-agentic-workflows.md
21+
#
22+
# Alternative regeneration methods:
23+
# make recompile
24+
#
25+
# Or use the gh-aw CLI directly:
26+
# ./gh-aw compile --validate --verbose
27+
#
28+
# The workflow is generated when any workflow uses the 'expires' field
29+
# in create-discussions, create-issues, or create-pull-request safe-outputs configuration.
30+
# Schedule frequency is automatically determined by the shortest expiration time.
31+
#
32+
name: Agentic Maintenance
33+
34+
on:
35+
schedule:
36+
- cron: "37 */2 * * *" # Every 2 hours (based on minimum expires: 1 days)
37+
workflow_dispatch:
38+
39+
permissions: {}
40+
41+
jobs:
42+
close-expired-entities:
43+
runs-on: ubuntu-slim
44+
permissions:
45+
discussions: write
46+
issues: write
47+
pull-requests: write
48+
steps:
49+
- name: Setup Scripts
50+
uses: github/gh-aw/actions/setup@v0.42.17
51+
with:
52+
destination: /opt/gh-aw/actions
53+
54+
- name: Close expired discussions
55+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
56+
with:
57+
script: |
58+
const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
59+
setupGlobals(core, github, context, exec, io);
60+
const { main } = require('/opt/gh-aw/actions/close_expired_discussions.cjs');
61+
await main();
62+
63+
- name: Close expired issues
64+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
65+
with:
66+
script: |
67+
const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
68+
setupGlobals(core, github, context, exec, io);
69+
const { main } = require('/opt/gh-aw/actions/close_expired_issues.cjs');
70+
await main();
71+
72+
- name: Close expired pull requests
73+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
74+
with:
75+
script: |
76+
const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
77+
setupGlobals(core, github, context, exec, io);
78+
const { main } = require('/opt/gh-aw/actions/close_expired_pull_requests.cjs');
79+
await main();

0 commit comments

Comments
 (0)