diff --git a/.github/workflows/agentic-campaign-generator.lock.yml b/.github/workflows/agentic-campaign-generator.lock.yml index 981e8f8d4b..9d52db73be 100644 --- a/.github/workflows/agentic-campaign-generator.lock.yml +++ b/.github/workflows/agentic-campaign-generator.lock.yml @@ -83,7 +83,7 @@ jobs: env: GH_AW_WORKFLOW_NAME: "Agentic Campaign Generator" GH_AW_LOCK_FOR_AGENT: "true" - GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Campaign coordination by [{workflow_name}]({run_url})*\",\"runStarted\":\"[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.\",\"runSuccess\":\"[{workflow_name}]({run_url}) has successfully set up your campaign. Copilot Coding Agent will now create a PR.\",\"runFailure\":\"[{workflow_name}]({run_url}) {status}. Please check the details and try again.\"}" + GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Managed by [{workflow_name}]({run_url})* Docs: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\",\"runStarted\":\"### :rocket: Campaign setup started\\nI’m creating a tracking Project and generating the campaign files + orchestrator workflow.\\nNext, I’ll open a pull request and post the link + checklist in this issue.\\n\\u003e To stop this run: remove the label that started it.\\n\\u003e To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\",\"runSuccess\":\"### :white_check_mark: Campaign setup complete\\nAll set — the tracking Project is created and the pull request with the generated campaign files is ready.\\nNext: review + merge the PR, then run the orchestrator from the Actions tab.\\n\\u003e To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\",\"runFailure\":\"### :x: Campaign setup {status}\\nThis is usually a quick fix. First check that `GH_AW_PROJECT_GITHUB_TOKEN` is set and has access to GitHub Projects.\\nRetry: fix the first error in the logs, then re-apply the label to re-run\\n\\u003e Troubleshooting: https://githubnext.github.io/gh-aw/guides/campaigns/flow/#when-something-goes-wrong\\n\\u003e To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\"}" with: script: | const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); @@ -1192,7 +1192,7 @@ jobs: GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.agent.outputs.secret_verification_result }} - GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Campaign coordination by [{workflow_name}]({run_url})*\",\"runStarted\":\"[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.\",\"runSuccess\":\"[{workflow_name}]({run_url}) has successfully set up your campaign. Copilot Coding Agent will now create a PR.\",\"runFailure\":\"[{workflow_name}]({run_url}) {status}. Please check the details and try again.\"}" + GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Managed by [{workflow_name}]({run_url})* Docs: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\",\"runStarted\":\"### :rocket: Campaign setup started\\nI’m creating a tracking Project and generating the campaign files + orchestrator workflow.\\nNext, I’ll open a pull request and post the link + checklist in this issue.\\n\\u003e To stop this run: remove the label that started it.\\n\\u003e To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\",\"runSuccess\":\"### :white_check_mark: Campaign setup complete\\nAll set — the tracking Project is created and the pull request with the generated campaign files is ready.\\nNext: review + merge the PR, then run the orchestrator from the Actions tab.\\n\\u003e To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\",\"runFailure\":\"### :x: Campaign setup {status}\\nThis is usually a quick fix. First check that `GH_AW_PROJECT_GITHUB_TOKEN` is set and has access to GitHub Projects.\\nRetry: fix the first error in the logs, then re-apply the label to re-run\\n\\u003e Troubleshooting: https://githubnext.github.io/gh-aw/guides/campaigns/flow/#when-something-goes-wrong\\n\\u003e To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\"}" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | @@ -1211,7 +1211,7 @@ jobs: GH_AW_WORKFLOW_NAME: "Agentic Campaign Generator" GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.result }} - GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Campaign coordination by [{workflow_name}]({run_url})*\",\"runStarted\":\"[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.\",\"runSuccess\":\"[{workflow_name}]({run_url}) has successfully set up your campaign. Copilot Coding Agent will now create a PR.\",\"runFailure\":\"[{workflow_name}]({run_url}) {status}. Please check the details and try again.\"}" + GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Managed by [{workflow_name}]({run_url})* Docs: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\",\"runStarted\":\"### :rocket: Campaign setup started\\nI’m creating a tracking Project and generating the campaign files + orchestrator workflow.\\nNext, I’ll open a pull request and post the link + checklist in this issue.\\n\\u003e To stop this run: remove the label that started it.\\n\\u003e To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\",\"runSuccess\":\"### :white_check_mark: Campaign setup complete\\nAll set — the tracking Project is created and the pull request with the generated campaign files is ready.\\nNext: review + merge the PR, then run the orchestrator from the Actions tab.\\n\\u003e To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\",\"runFailure\":\"### :x: Campaign setup {status}\\nThis is usually a quick fix. First check that `GH_AW_PROJECT_GITHUB_TOKEN` is set and has access to GitHub Projects.\\nRetry: fix the first error in the logs, then re-apply the label to re-run\\n\\u003e Troubleshooting: https://githubnext.github.io/gh-aw/guides/campaigns/flow/#when-something-goes-wrong\\n\\u003e To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\"}" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | @@ -1452,7 +1452,7 @@ jobs: timeout-minutes: 15 env: GH_AW_ENGINE_ID: "claude" - GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Campaign coordination by [{workflow_name}]({run_url})*\",\"runStarted\":\"[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.\",\"runSuccess\":\"[{workflow_name}]({run_url}) has successfully set up your campaign. Copilot Coding Agent will now create a PR.\",\"runFailure\":\"[{workflow_name}]({run_url}) {status}. Please check the details and try again.\"}" + GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Managed by [{workflow_name}]({run_url})* Docs: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\",\"runStarted\":\"### :rocket: Campaign setup started\\nI’m creating a tracking Project and generating the campaign files + orchestrator workflow.\\nNext, I’ll open a pull request and post the link + checklist in this issue.\\n\\u003e To stop this run: remove the label that started it.\\n\\u003e To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\",\"runSuccess\":\"### :white_check_mark: Campaign setup complete\\nAll set — the tracking Project is created and the pull request with the generated campaign files is ready.\\nNext: review + merge the PR, then run the orchestrator from the Actions tab.\\n\\u003e To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\",\"runFailure\":\"### :x: Campaign setup {status}\\nThis is usually a quick fix. First check that `GH_AW_PROJECT_GITHUB_TOKEN` is set and has access to GitHub Projects.\\nRetry: fix the first error in the logs, then re-apply the label to re-run\\n\\u003e Troubleshooting: https://githubnext.github.io/gh-aw/guides/campaigns/flow/#when-something-goes-wrong\\n\\u003e To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/\"}" GH_AW_WORKFLOW_ID: "agentic-campaign-generator" GH_AW_WORKFLOW_NAME: "Agentic Campaign Generator" outputs: diff --git a/.github/workflows/agentic-campaign-generator.md b/.github/workflows/agentic-campaign-generator.md index 0eedc975ca..274d166942 100644 --- a/.github/workflows/agentic-campaign-generator.md +++ b/.github/workflows/agentic-campaign-generator.md @@ -68,10 +68,33 @@ safe-outputs: - name: "end_date" data-type: "DATE" messages: - footer: "> *Campaign coordination by [{workflow_name}]({run_url})*" - run-started: "[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}." - run-success: "[{workflow_name}]({run_url}) has successfully set up your campaign. Copilot Coding Agent will now create a PR." - run-failure: "[{workflow_name}]({run_url}) {status}. Please check the details and try again." + footer: "> *Managed by [{workflow_name}]({run_url})* +Docs: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/" + run-started: "### :rocket: Campaign setup started + +I’m creating a tracking Project and generating the campaign files + orchestrator workflow. + +Next, I’ll open a pull request and post the link + checklist in this issue. + +> To stop this run: remove the label that started it. + +> To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/" + run-success: "### :white_check_mark: Campaign setup complete + +All set — the tracking Project is created and the pull request with the generated campaign files is ready. + +Next: review + merge the PR, then run the orchestrator from the Actions tab. + +> To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/" + run-failure: "### :x: Campaign setup {status} + +This is usually a quick fix. First check that `GH_AW_PROJECT_GITHUB_TOKEN` is set and has access to GitHub Projects. + +Retry: fix the first error in the logs, then re-apply the label to re-run + +> Troubleshooting: https://githubnext.github.io/gh-aw/guides/campaigns/flow/#when-something-goes-wrong + +> To learn more about campaigns, visit: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/" timeout-minutes: 10 --- diff --git a/pkg/campaign/generator.go b/pkg/campaign/generator.go index 8a248fa30f..6ac5937a65 100644 --- a/pkg/campaign/generator.go +++ b/pkg/campaign/generator.go @@ -128,27 +128,28 @@ func buildGeneratorSafeOutputs() *workflow.SafeOutputsConfig { }, }, Messages: &workflow.SafeOutputMessagesConfig{ - Footer: "> *Campaign coordination by [{workflow_name}]({run_url})*\n" + - "Docs: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/", - RunStarted: "[{workflow_name}]({run_url}) started generating your campaign (trigger: {event_type}).\n\n" + - "**What’s happening**\n" + - "1. Read requirements from this issue\n" + - "2. Create a GitHub Project (views + standard fields)\n" + - "3. Generate a campaign spec + orchestrator workflow\n" + - "4. Update this issue with a handoff checklist\n\n" + - "You don’t need to do anything yet. When it finishes, look for a PR link in the issue update.\n\n" + - "Learn more: https://githubnext.github.io/gh-aw/guides/campaigns/flow/", - RunSuccess: "[{workflow_name}]({run_url}) finished the initial campaign setup.\n\n" + - "**Next steps**\n" + - "1. Review the pull request created by the Copilot Coding Agent\n" + - "2. Merge it\n" + - "3. Run the campaign orchestrator from the Actions tab\n\n" + - "Docs: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/", - RunFailure: "[{workflow_name}]({run_url}) {status}.\n\n" + - "**What to do**\n" + - "- Open the run link above and check the logs for the first error\n" + - "- Fix the issue (permissions/secret/config), then re-run by re-applying the label\n\n" + - "Troubleshooting: https://githubnext.github.io/gh-aw/guides/campaigns/flow/#when-something-goes-wrong", + Footer: "> *Managed by [{workflow_name}]({run_url})*\n" + + "> Docs: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/", + RunStarted: "### :rocket: Campaign setup started\n\n" + + "Creating a tracking Project and generating campaign files + orchestrator workflow.\n\n" + + "No action needed right now — this run will open a pull request and post the link + checklist back on this issue when ready.\n\n" + + "> To stop this run: remove the label that started it.\n" + + "> Docs: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/", + RunSuccess: "### :white_check_mark: Campaign setup complete\n\n" + + "Tracking Project created and pull request with generated campaign files is ready.\n\n" + + "Next steps:\n" + + "- Review + merge the PR\n" + + "- Run the campaign from the Actions tab\n\n" + + "> Docs: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/", + RunFailure: "### :x: Campaign setup {status}\n\n" + + "Common causes:\n" + + "- `GH_AW_PROJECT_GITHUB_TOKEN` is missing or invalid\n" + + "- Token lacks access to GitHub Projects\n\n" + + "Action required:\n" + + "- Fix the first error in the logs\n" + + "- Re-apply the label to re-run\n\n" + + "> Troubleshooting: https://githubnext.github.io/gh-aw/guides/campaigns/flow/#when-something-goes-wrong\n" + + "> Docs: https://githubnext.github.io/gh-aw/guides/campaigns/getting-started/", }, } }