Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/aw/generate-agentic-campaign.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ allowed-safe-outputs: [create-issue, add-comment]
3. `update-issue` (updates metadata, optional)
4. `assign-to-agent` (assigns agents, optional)

**Example Safe Outputs Configuration for Project-Based Campaigns:**

When configuring safe outputs, place the `views` array under `create-project` (not `update-project`):
- `create-project.views` - Views are created automatically when project is created
- `create-project.github-token` - Use the GH_AW_PROJECT_GITHUB_TOKEN secret
- `create-project.target-owner` - Use github.repository_owner expression

The three standard views for campaigns are:
1. Campaign Roadmap (layout: roadmap)
2. Task Tracker (layout: table)
3. Progress Board (layout: board)

**Risk Levels:**
- High: Sensitive/multi-repo/breaking → 2 approvals + sponsor
- Medium: Cross-repo/automated → 1 approval
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/agentic-campaign-generator.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .github/workflows/agentic-campaign-generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ safe-outputs:
max: 1
github-token: "${{ secrets.GH_AW_PROJECT_GITHUB_TOKEN }}"
target-owner: "${{ github.repository_owner }}"
update-project:
max: 10
github-token: "${{ secrets.GH_AW_PROJECT_GITHUB_TOKEN }}"
views:
- name: "Campaign Roadmap"
layout: "roadmap"
Expand All @@ -38,6 +35,9 @@ safe-outputs:
- name: "Progress Board"
layout: "board"
filter: "is:issue is:pr"
update-project:
max: 10
github-token: "${{ secrets.GH_AW_PROJECT_GITHUB_TOKEN }}"
messages:
footer: "> *Campaign coordination by [{workflow_name}]({run_url})*"
run-started: "Campaign Generator starting! [{workflow_name}]({run_url}) is processing your campaign request for this {event_type}..."
Expand Down
6 changes: 3 additions & 3 deletions pkg/campaign/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ func buildGeneratorSafeOutputs() *workflow.SafeOutputsConfig {
CreateProjects: &workflow.CreateProjectsConfig{
GitHubToken: "${{ secrets.GH_AW_PROJECT_GITHUB_TOKEN }}",
TargetOwner: "${{ github.repository_owner }}",
},
UpdateProjects: &workflow.UpdateProjectConfig{
GitHubToken: "${{ secrets.GH_AW_PROJECT_GITHUB_TOKEN }}",
Views: []workflow.ProjectView{
{
Name: "Campaign Roadmap",
Expand All @@ -91,6 +88,9 @@ func buildGeneratorSafeOutputs() *workflow.SafeOutputsConfig {
},
},
},
UpdateProjects: &workflow.UpdateProjectConfig{
GitHubToken: "${{ secrets.GH_AW_PROJECT_GITHUB_TOKEN }}",
},
Messages: &workflow.SafeOutputMessagesConfig{
Footer: "> *Campaign coordination by [{workflow_name}]({run_url})*",
RunStarted: "Campaign Generator starting! [{workflow_name}]({run_url}) is processing your campaign request for this {event_type}...",
Expand Down
3 changes: 0 additions & 3 deletions pkg/cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ var debugWorkflowPromptTemplate string
//go:embed templates/upgrade-agentic-workflows.md
var upgradeAgenticWorkflowsPromptTemplate string

//go:embed templates/create-agentic-campaign.md
var campaignCreationInstructionsTemplate string

//go:embed templates/generate-agentic-campaign.md
var campaignGeneratorInstructionsTemplate string

Expand Down
12 changes: 0 additions & 12 deletions pkg/cli/copilot-agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,18 +271,6 @@ func ensureCampaignGeneratorInstructions(verbose bool, skipInstructions bool) er
)
}

// ensureCampaignCreationInstructions ensures that .github/aw/create-agentic-campaign.md exists
func ensureCampaignCreationInstructions(verbose bool, skipInstructions bool) error {
return ensureFileMatchesTemplate(
filepath.Join(".github", "aw"),
"create-agentic-campaign.md",
campaignCreationInstructionsTemplate,
"campaign creation instructions",
verbose,
skipInstructions,
)
}

// deleteSetupAgenticWorkflowsAgent deletes the setup-agentic-workflows.agent.md file if it exists
func deleteSetupAgenticWorkflowsAgent(verbose bool) error {
gitRoot, err := findGitRoot()
Expand Down
17 changes: 8 additions & 9 deletions pkg/cli/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ func InitRepository(verbose bool, mcp bool, campaign bool, tokens bool, engine s
fn func(bool, bool) error
name string
}{
{ensureCampaignCreationInstructions, "campaign creation instructions"},
{ensureCampaignOrchestratorInstructions, "campaign orchestrator instructions"},
{ensureCampaignProjectUpdateInstructions, "campaign project update instructions"},
{ensureCampaignWorkflowExecution, "campaign workflow execution"},
Expand Down Expand Up @@ -484,6 +483,14 @@ func renderCampaignGeneratorMarkdown(data *workflow.WorkflowData) string {
if data.SafeOutputs.CreateProjects.TargetOwner != "" {
fmt.Fprintf(&b, " target-owner: \"%s\"\n", data.SafeOutputs.CreateProjects.TargetOwner)
}
if len(data.SafeOutputs.CreateProjects.Views) > 0 {
b.WriteString(" views:\n")
for _, view := range data.SafeOutputs.CreateProjects.Views {
fmt.Fprintf(&b, " - name: \"%s\"\n", view.Name)
fmt.Fprintf(&b, " layout: \"%s\"\n", view.Layout)
fmt.Fprintf(&b, " filter: \"%s\"\n", view.Filter)
}
}
}

if data.SafeOutputs.UpdateProjects != nil {
Expand All @@ -492,14 +499,6 @@ func renderCampaignGeneratorMarkdown(data *workflow.WorkflowData) string {
if data.SafeOutputs.UpdateProjects.GitHubToken != "" {
fmt.Fprintf(&b, " github-token: \"%s\"\n", data.SafeOutputs.UpdateProjects.GitHubToken)
}
if len(data.SafeOutputs.UpdateProjects.Views) > 0 {
b.WriteString(" views:\n")
for _, view := range data.SafeOutputs.UpdateProjects.Views {
fmt.Fprintf(&b, " - name: \"%s\"\n", view.Name)
fmt.Fprintf(&b, " layout: \"%s\"\n", view.Layout)
fmt.Fprintf(&b, " filter: \"%s\"\n", view.Filter)
}
}
}

if data.SafeOutputs.Messages != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ func TestInitRepository_Campaign(t *testing.T) {
t.Fatalf("Failed to read agentic-campaign-generator workflow: %v", err)
}
workflowStr := string(workflowContent)
if !strings.Contains(workflowStr, "description: \"Campaign generator") {
t.Errorf("Expected campaign-generator workflow to contain description")
if !strings.Contains(workflowStr, "Agentic Campaign generator") {
t.Errorf("Expected campaign-generator workflow to contain description with 'Agentic Campaign generator'")
}
if !strings.Contains(workflowStr, "create-agentic-campaign") {
t.Errorf("Expected campaign-generator workflow to trigger on 'create-agentic-campaign' label")
Expand Down
12 changes: 12 additions & 0 deletions pkg/cli/templates/generate-agentic-campaign.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ allowed-safe-outputs: [create-issue, add-comment]
3. `update-issue` (updates metadata, optional)
4. `assign-to-agent` (assigns agents, optional)

**Example Safe Outputs Configuration for Project-Based Campaigns:**

When configuring safe outputs, place the `views` array under `create-project` (not `update-project`):
- `create-project.views` - Views are created automatically when project is created
- `create-project.github-token` - Use the GH_AW_PROJECT_GITHUB_TOKEN secret
- `create-project.target-owner` - Use github.repository_owner expression

The three standard views for campaigns are:
1. Campaign Roadmap (layout: roadmap)
2. Task Tracker (layout: table)
3. Progress Board (layout: board)

**Risk Levels:**
- High: Sensitive/multi-repo/breaking → 2 approvals + sponsor
- Medium: Cross-repo/automated → 1 approval
Expand Down
Loading
Loading