Skip to content

Commit 3268caa

Browse files
authored
Merge branch 'main' into token-getter
2 parents e83c891 + 3614bbd commit 3268caa

File tree

6 files changed

+68
-0
lines changed

6 files changed

+68
-0
lines changed

.github/aw/github-agentic-workflows.md

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

.github/workflows/install.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ jobs:
108108

109109
- name: Test full install script (without dummy version)
110110
shell: bash
111+
env:
112+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111113
run: |
112114
chmod +x install-gh-aw.sh
113115

docs/src/content/docs/reference/frontmatter-full.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ on:
216216
names: []
217217
# Array items: Label name
218218

219+
# Whether to lock the issue for the agent when the workflow runs (prevents
220+
# concurrent modifications)
221+
# (optional)
222+
lock-for-agent: true
223+
219224
# Issue comment event trigger
220225
# (optional)
221226
issue_comment:

docs/src/content/docs/reference/glossary.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,22 @@ The process of checking workflow files for errors, security issues, and best pra
195195
### Cache Memory
196196
Persistent storage for workflows that preserves data between runs. Configured using `cache-memory:` in the tools section, it enables workflows to remember information and build on previous interactions.
197197

198+
### Campaign
199+
A finite, enterprise-scale initiative with explicit ownership, approval gates, and executive visibility. Campaigns orchestrate business outcomes (security remediation, dependency updates, compliance enforcement) across multiple repositories with governance, accountability, and ROI tracking. Unlike regular workflows that execute operations, campaigns manage business initiatives with measurable outcomes, defined budgets, stakeholder reporting, and compliance audit trails.
200+
201+
**Key characteristics:**
202+
- Finite duration (days to months) with clear start and end
203+
- Named owners and executive sponsors
204+
- Formal approval gates and change control
205+
- Budget tracking with ROI metrics
206+
- Stateful execution using repo-memory for audit trails
207+
- Cross-team and cross-repository coordination
208+
- Executive dashboards and KPI reporting
209+
210+
**File naming:** Use `.campaign.md` extension (e.g., `security-compliance.campaign.md`)
211+
212+
See the [Campaigns Guide](/gh-aw/guides/campaigns/) for implementation patterns and examples.
213+
198214
### Command Triggers
199215
Special triggers that respond to slash commands in issue and PR comments (e.g., `/review`, `/deploy`). Configured using the `command:` section with a command name.
200216

pkg/workflow/js.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ var sanitizeWorkflowNameScript string
112112
//go:embed js/load_agent_output.cjs
113113
var loadAgentOutputScript string
114114

115+
//go:embed js/lock-issue.cjs
116+
var lockIssueScript string
117+
115118
//go:embed js/staged_preview.cjs
116119
var stagedPreviewScript string
117120

@@ -278,6 +281,7 @@ func GetJavaScriptSources() map[string]string {
278281
"sanitize_label_content.cjs": sanitizeLabelContentScript,
279282
"sanitize_workflow_name.cjs": sanitizeWorkflowNameScript,
280283
"load_agent_output.cjs": loadAgentOutputScript,
284+
"lock-issue.cjs": lockIssueScript,
281285
"staged_preview.cjs": stagedPreviewScript,
282286
"assign_agent_helpers.cjs": assignAgentHelpersScript,
283287
"safe_output_helpers.cjs": safeOutputHelpersScript,

pkg/workflow/js/lock-issue.cjs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// @ts-check
2+
/// <reference types="@actions/github-script" />
3+
4+
/**
5+
* Lock a GitHub issue without providing a reason
6+
* This script is used in the activation job when lock-for-agent is enabled
7+
* to prevent concurrent modifications during agent workflow execution
8+
*/
9+
10+
async function main() {
11+
// Get issue number from context
12+
const issueNumber = context.issue.number;
13+
14+
if (!issueNumber) {
15+
core.setFailed("Issue number not found in context");
16+
return;
17+
}
18+
19+
const owner = context.repo.owner;
20+
const repo = context.repo.repo;
21+
22+
core.info(`Locking issue #${issueNumber} for agent workflow execution`);
23+
24+
try {
25+
// Lock the issue without providing a lock_reason parameter
26+
await github.rest.issues.lock({
27+
owner,
28+
repo,
29+
issue_number: issueNumber,
30+
});
31+
32+
core.info(`✅ Successfully locked issue #${issueNumber}`);
33+
} catch (error) {
34+
const errorMessage = error instanceof Error ? error.message : String(error);
35+
core.error(`Failed to lock issue: ${errorMessage}`);
36+
core.setFailed(`Failed to lock issue #${issueNumber}: ${errorMessage}`);
37+
}
38+
}
39+
40+
await main();

0 commit comments

Comments
 (0)