diff --git a/.changeset/patch-convert-pr-safe-outputs-handler-manager.md b/.changeset/patch-convert-pr-safe-outputs-handler-manager.md
new file mode 100644
index 00000000000..81a53d7d3d0
--- /dev/null
+++ b/.changeset/patch-convert-pr-safe-outputs-handler-manager.md
@@ -0,0 +1,11 @@
+---
+"gh-aw": patch
+---
+
+Convert PR-related safe outputs and the `hide-comment` safe output to the
+handler-manager architecture used by other safe outputs (e.g. `create-issue`).
+
+This is an internal refactor: handlers now use the handler factory pattern,
+enforce max counts, return result objects, and are managed by the handler
+manager. TypeScript, linting, and Go formatting were applied.
+
diff --git a/.changeset/patch-convert-pr-safe-outputs-to-handler-manager.md b/.changeset/patch-convert-pr-safe-outputs-to-handler-manager.md
new file mode 100644
index 00000000000..ee01e72bf01
--- /dev/null
+++ b/.changeset/patch-convert-pr-safe-outputs-to-handler-manager.md
@@ -0,0 +1,8 @@
+---
+"gh-aw": patch
+---
+
+Converted PR-related safe outputs and `hide-comment` to the handler manager architecture. Internal refactor only; no user-facing API changes.
+
+Ahoy! This changeset was generated for PR #8683 by the Changeset Generator.
+
diff --git a/.github/workflows/ai-moderator.lock.yml b/.github/workflows/ai-moderator.lock.yml
index 8c4cf61bda5..61d9de07255 100644
--- a/.github/workflows/ai-moderator.lock.yml
+++ b/.github/workflows/ai-moderator.lock.yml
@@ -1110,7 +1110,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_labels\":{\"allowed\":[\"spam\",\"ai-generated\",\"link-spam\",\"ai-inspected\"],\"target\":\"*\"}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_labels\":{\"allowed\":[\"spam\",\"ai-generated\",\"link-spam\",\"ai-inspected\"],\"target\":\"*\"},\"hide_comment\":{\"allowed_reasons\":[\"spam\"],\"max\":5}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
@@ -1118,17 +1118,4 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Hide Comment
- id: hide_comment
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'hide_comment'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/hide_comment.cjs');
- await main();
diff --git a/.github/workflows/changeset.lock.yml b/.github/workflows/changeset.lock.yml
index 01d2be32241..7a31ab99770 100644
--- a/.github/workflows/changeset.lock.yml
+++ b/.github/workflows/changeset.lock.yml
@@ -1331,7 +1331,8 @@ jobs:
GH_AW_WORKFLOW_ID: "changeset"
GH_AW_WORKFLOW_NAME: "Changeset Generator"
outputs:
- push_to_pull_request_branch_commit_url: ${{ steps.push_to_pull_request_branch.outputs.commit_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1391,34 +1392,18 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ steps.app-token.outputs.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Update Pull Request
- id: update_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'update_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"push_to_pull_request_branch\":{\"base_branch\":\"${{ github.ref_name }}\",\"commit_title_suffix\":\" [skip-ci]\",\"if_no_changes\":\"warn\",\"max_patch_size\":1024},\"update_pull_request\":{\"allow_body\":true,\"allow_title\":false,\"max\":1}}"
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/update_pull_request.cjs');
- await main();
- - name: Push To Pull Request Branch
- id: push_to_pull_request_branch
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'push_to_pull_request_branch'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_PUSH_IF_NO_CHANGES: "warn"
- GH_AW_COMMIT_TITLE_SUFFIX: " [skip-ci]"
- GH_AW_MAX_PATCH_SIZE: 1024
- with:
- github-token: ${{ steps.app-token.outputs.token }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/push_to_pull_request_branch.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- name: Invalidate GitHub App token
if: always() && steps.app-token.outputs.token != ''
diff --git a/.github/workflows/ci-coach.lock.yml b/.github/workflows/ci-coach.lock.yml
index 0e0aa8e3807..1222189c778 100644
--- a/.github/workflows/ci-coach.lock.yml
+++ b/.github/workflows/ci-coach.lock.yml
@@ -1899,8 +1899,8 @@ jobs:
GH_AW_WORKFLOW_ID: "ci-coach"
GH_AW_WORKFLOW_NAME: "CI Optimization Coach"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1948,24 +1948,18 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[ci-coach] "
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[ci-coach] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
update_cache_memory:
diff --git a/.github/workflows/cloclo.lock.yml b/.github/workflows/cloclo.lock.yml
index 74998c38cda..88bd373a6ac 100644
--- a/.github/workflows/cloclo.lock.yml
+++ b/.github/workflows/cloclo.lock.yml
@@ -1686,8 +1686,6 @@ jobs:
GH_AW_WORKFLOW_ID: "cloclo"
GH_AW_WORKFLOW_NAME: "/cloclo"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
@@ -1742,7 +1740,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"labels\":[\"automation\",\"cloclo\"],\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[cloclo] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
@@ -1750,28 +1748,6 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[cloclo] "
- GH_AW_PR_LABELS: "automation,cloclo"
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
- GH_AW_COMMENT_ID: ${{ needs.activation.outputs.comment_id }}
- GH_AW_COMMENT_REPO: ${{ needs.activation.outputs.comment_repo }}
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
- await main();
update_cache_memory:
needs:
diff --git a/.github/workflows/craft.lock.yml b/.github/workflows/craft.lock.yml
index 4fdf8ca3350..2b628034e11 100644
--- a/.github/workflows/craft.lock.yml
+++ b/.github/workflows/craft.lock.yml
@@ -1397,7 +1397,6 @@ jobs:
outputs:
process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
- push_to_pull_request_branch_commit_url: ${{ steps.push_to_pull_request_branch.outputs.commit_url }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1450,7 +1449,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"push_to_pull_request_branch\":{\"base_branch\":\"${{ github.ref_name }}\",\"if_no_changes\":\"warn\",\"max_patch_size\":1024}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
@@ -1458,19 +1457,4 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Push To Pull Request Branch
- id: push_to_pull_request_branch
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'push_to_pull_request_branch'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_PUSH_IF_NO_CHANGES: "warn"
- GH_AW_MAX_PATCH_SIZE: 1024
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/push_to_pull_request_branch.cjs');
- await main();
diff --git a/.github/workflows/daily-doc-updater.lock.yml b/.github/workflows/daily-doc-updater.lock.yml
index bab2a388b99..034f8d1d521 100644
--- a/.github/workflows/daily-doc-updater.lock.yml
+++ b/.github/workflows/daily-doc-updater.lock.yml
@@ -1314,8 +1314,8 @@ jobs:
GH_AW_WORKFLOW_ID: "daily-doc-updater"
GH_AW_WORKFLOW_NAME: "Daily Documentation Updater"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1363,23 +1363,18 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"max\":1,\"max_patch_size\":1024}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
update_cache_memory:
diff --git a/.github/workflows/daily-workflow-updater.lock.yml b/.github/workflows/daily-workflow-updater.lock.yml
index a9312301bac..9edd9429619 100644
--- a/.github/workflows/daily-workflow-updater.lock.yml
+++ b/.github/workflows/daily-workflow-updater.lock.yml
@@ -1201,8 +1201,8 @@ jobs:
GH_AW_WORKFLOW_ID: "daily-workflow-updater"
GH_AW_WORKFLOW_NAME: "Daily Workflow Updater"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1250,24 +1250,17 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[actions] "
- GH_AW_PR_LABELS: "dependencies,automation"
- GH_AW_PR_DRAFT: "false"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"draft\":false,\"labels\":[\"dependencies\",\"automation\"],\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[actions] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
diff --git a/.github/workflows/developer-docs-consolidator.lock.yml b/.github/workflows/developer-docs-consolidator.lock.yml
index 730fbdbf7dd..cf69437207b 100644
--- a/.github/workflows/developer-docs-consolidator.lock.yml
+++ b/.github/workflows/developer-docs-consolidator.lock.yml
@@ -1844,8 +1844,6 @@ jobs:
GH_AW_WORKFLOW_ID: "developer-docs-consolidator"
GH_AW_WORKFLOW_NAME: "Developer Documentation Consolidator"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
@@ -1900,7 +1898,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_discussion\":{\"category\":\"General\",\"close_older_discussions\":true,\"max\":1}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_discussion\":{\"category\":\"General\",\"close_older_discussions\":true,\"max\":1},\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"draft\":false,\"labels\":[\"documentation\",\"automation\"],\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[docs] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
@@ -1908,26 +1906,6 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[docs] "
- GH_AW_PR_LABELS: "documentation,automation"
- GH_AW_PR_DRAFT: "false"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
- await main();
update_cache_memory:
needs:
diff --git a/.github/workflows/dictation-prompt.lock.yml b/.github/workflows/dictation-prompt.lock.yml
index fa57ee7ba4e..649fb9b5bed 100644
--- a/.github/workflows/dictation-prompt.lock.yml
+++ b/.github/workflows/dictation-prompt.lock.yml
@@ -1096,8 +1096,8 @@ jobs:
GH_AW_WORKFLOW_ID: "dictation-prompt"
GH_AW_WORKFLOW_NAME: "Dictation Prompt Generator"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1145,24 +1145,17 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[docs] "
- GH_AW_PR_LABELS: "documentation,automation"
- GH_AW_PR_DRAFT: "false"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"draft\":false,\"labels\":[\"documentation\",\"automation\"],\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[docs] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
diff --git a/.github/workflows/github-mcp-tools-report.lock.yml b/.github/workflows/github-mcp-tools-report.lock.yml
index 657bc2a6f3d..caba2386f71 100644
--- a/.github/workflows/github-mcp-tools-report.lock.yml
+++ b/.github/workflows/github-mcp-tools-report.lock.yml
@@ -1684,8 +1684,6 @@ jobs:
GH_AW_WORKFLOW_ID: "github-mcp-tools-report"
GH_AW_WORKFLOW_NAME: "GitHub MCP Remote Server Tools Report Generator"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
@@ -1740,7 +1738,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_discussion\":{\"category\":\"audits\",\"close_older_discussions\":true,\"max\":1}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_discussion\":{\"category\":\"audits\",\"close_older_discussions\":true,\"max\":1},\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"max\":1,\"max_patch_size\":1024}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
@@ -1748,24 +1746,6 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
- await main();
update_cache_memory:
needs:
diff --git a/.github/workflows/glossary-maintainer.lock.yml b/.github/workflows/glossary-maintainer.lock.yml
index 942943ed5e0..6beb9306e03 100644
--- a/.github/workflows/glossary-maintainer.lock.yml
+++ b/.github/workflows/glossary-maintainer.lock.yml
@@ -1744,8 +1744,8 @@ jobs:
GH_AW_WORKFLOW_ID: "glossary-maintainer"
GH_AW_WORKFLOW_NAME: "Glossary Maintainer"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1793,25 +1793,18 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[docs] "
- GH_AW_PR_LABELS: "documentation,glossary"
- GH_AW_PR_DRAFT: "false"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"draft\":false,\"labels\":[\"documentation\",\"glossary\"],\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[docs] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
update_cache_memory:
diff --git a/.github/workflows/go-logger.lock.yml b/.github/workflows/go-logger.lock.yml
index f7bc68af9a3..93a0b87647b 100644
--- a/.github/workflows/go-logger.lock.yml
+++ b/.github/workflows/go-logger.lock.yml
@@ -1409,8 +1409,8 @@ jobs:
GH_AW_WORKFLOW_ID: "go-logger"
GH_AW_WORKFLOW_NAME: "Go Logger Enhancement"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1458,25 +1458,18 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[log] "
- GH_AW_PR_LABELS: "enhancement,automation"
- GH_AW_PR_DRAFT: "false"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"draft\":false,\"labels\":[\"enhancement\",\"automation\"],\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[log] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
update_cache_memory:
diff --git a/.github/workflows/hourly-ci-cleaner.lock.yml b/.github/workflows/hourly-ci-cleaner.lock.yml
index a7b23f93708..ec9ad83542f 100644
--- a/.github/workflows/hourly-ci-cleaner.lock.yml
+++ b/.github/workflows/hourly-ci-cleaner.lock.yml
@@ -1449,8 +1449,8 @@ jobs:
GH_AW_WORKFLOW_ID: "hourly-ci-cleaner"
GH_AW_WORKFLOW_NAME: "CI Cleaner"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1498,23 +1498,17 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[ca] "
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[ca] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
diff --git a/.github/workflows/incident-response.lock.yml b/.github/workflows/incident-response.lock.yml
index 1d99dfd89ac..10db4105ae8 100644
--- a/.github/workflows/incident-response.lock.yml
+++ b/.github/workflows/incident-response.lock.yml
@@ -1737,8 +1737,6 @@ jobs:
GH_AW_WORKFLOW_ID: "incident-response"
GH_AW_WORKFLOW_NAME: "Campaign - Incident Response"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
@@ -1793,7 +1791,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"add_labels\":{},\"create_issue\":{\"labels\":[\"campaign-tracker\",\"incident\"],\"max\":1}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"add_labels\":{},\"create_issue\":{\"labels\":[\"campaign-tracker\",\"incident\"],\"max\":1},\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"labels\":[\"campaign-fix\",\"incident\"],\"max\":1,\"max_patch_size\":1024}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
@@ -1801,23 +1799,4 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_LABELS: "campaign-fix,incident"
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
- await main();
diff --git a/.github/workflows/instructions-janitor.lock.yml b/.github/workflows/instructions-janitor.lock.yml
index ca295c6351f..3ba60a12874 100644
--- a/.github/workflows/instructions-janitor.lock.yml
+++ b/.github/workflows/instructions-janitor.lock.yml
@@ -1289,8 +1289,8 @@ jobs:
GH_AW_WORKFLOW_ID: "instructions-janitor"
GH_AW_WORKFLOW_NAME: "Instructions Janitor"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1338,25 +1338,18 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[instructions] "
- GH_AW_PR_LABELS: "documentation,automation,instructions"
- GH_AW_PR_DRAFT: "false"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"draft\":false,\"labels\":[\"documentation\",\"automation\",\"instructions\"],\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[instructions] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
update_cache_memory:
diff --git a/.github/workflows/issue-template-optimizer.lock.yml b/.github/workflows/issue-template-optimizer.lock.yml
index 17b16de5c7e..04a357aa4ac 100644
--- a/.github/workflows/issue-template-optimizer.lock.yml
+++ b/.github/workflows/issue-template-optimizer.lock.yml
@@ -1338,8 +1338,8 @@ jobs:
GH_AW_WORKFLOW_ID: "issue-template-optimizer"
GH_AW_WORKFLOW_NAME: "Issue Template Optimizer"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1387,25 +1387,18 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[ca] "
- GH_AW_PR_LABELS: "documentation,templates"
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"draft\":true,\"labels\":[\"documentation\",\"templates\"],\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[ca] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
update_cache_memory:
diff --git a/.github/workflows/jsweep.lock.yml b/.github/workflows/jsweep.lock.yml
index fcff75e8b17..b5ab6a063b4 100644
--- a/.github/workflows/jsweep.lock.yml
+++ b/.github/workflows/jsweep.lock.yml
@@ -1376,8 +1376,8 @@ jobs:
GH_AW_WORKFLOW_ID: "jsweep"
GH_AW_WORKFLOW_NAME: "jsweep - JavaScript Unbloater"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1425,25 +1425,18 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[jsweep] "
- GH_AW_PR_LABELS: "unbloat,automation"
- GH_AW_PR_DRAFT: "false"
- GH_AW_PR_IF_NO_CHANGES: "ignore"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"draft\":false,\"if_no_changes\":\"ignore\",\"labels\":[\"unbloat\",\"automation\"],\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[jsweep] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
update_cache_memory:
diff --git a/.github/workflows/layout-spec-maintainer.lock.yml b/.github/workflows/layout-spec-maintainer.lock.yml
index b54d853a3ec..da7b6a78d8e 100644
--- a/.github/workflows/layout-spec-maintainer.lock.yml
+++ b/.github/workflows/layout-spec-maintainer.lock.yml
@@ -1316,8 +1316,8 @@ jobs:
GH_AW_WORKFLOW_ID: "layout-spec-maintainer"
GH_AW_WORKFLOW_NAME: "Layout Specification Maintainer"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1365,24 +1365,17 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[specs] "
- GH_AW_PR_LABELS: "documentation,automation"
- GH_AW_PR_DRAFT: "false"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"draft\":false,\"labels\":[\"documentation\",\"automation\"],\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[specs] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
diff --git a/.github/workflows/mergefest.lock.yml b/.github/workflows/mergefest.lock.yml
index ca05fce89fd..d308e132dc9 100644
--- a/.github/workflows/mergefest.lock.yml
+++ b/.github/workflows/mergefest.lock.yml
@@ -1428,7 +1428,8 @@ jobs:
GH_AW_WORKFLOW_ID: "mergefest"
GH_AW_WORKFLOW_NAME: "Mergefest"
outputs:
- push_to_pull_request_branch_commit_url: ${{ steps.push_to_pull_request_branch.outputs.commit_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1476,19 +1477,17 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Push To Pull Request Branch
- id: push_to_pull_request_branch
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'push_to_pull_request_branch'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_PUSH_IF_NO_CHANGES: "warn"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"push_to_pull_request_branch\":{\"base_branch\":\"${{ github.ref_name }}\",\"if_no_changes\":\"warn\",\"max_patch_size\":1024}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/push_to_pull_request_branch.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
diff --git a/.github/workflows/org-wide-rollout.lock.yml b/.github/workflows/org-wide-rollout.lock.yml
index a6376b7bd0a..53259de1efd 100644
--- a/.github/workflows/org-wide-rollout.lock.yml
+++ b/.github/workflows/org-wide-rollout.lock.yml
@@ -1765,8 +1765,6 @@ jobs:
GH_AW_WORKFLOW_ID: "org-wide-rollout"
GH_AW_WORKFLOW_NAME: "Campaign - Org-Wide Rollout"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
@@ -1821,7 +1819,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"add_labels\":{},\"create_issue\":{\"labels\":[\"campaign-tracker\",\"org-rollout\"],\"max\":1}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"add_labels\":{},\"create_issue\":{\"labels\":[\"campaign-tracker\",\"org-rollout\"],\"max\":1},\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"labels\":[\"campaign-pr\",\"org-rollout\"],\"max\":1,\"max_patch_size\":1024}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
@@ -1829,23 +1827,4 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_LABELS: "campaign-pr,org-rollout"
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
- await main();
diff --git a/.github/workflows/playground-snapshots-refresh.lock.yml b/.github/workflows/playground-snapshots-refresh.lock.yml
index 260aab75b2a..1152ef46e4b 100644
--- a/.github/workflows/playground-snapshots-refresh.lock.yml
+++ b/.github/workflows/playground-snapshots-refresh.lock.yml
@@ -1070,8 +1070,8 @@ jobs:
GH_AW_WORKFLOW_ID: "playground-snapshots-refresh"
GH_AW_WORKFLOW_NAME: "Refresh playground snapshots"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1119,24 +1119,17 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[docs] "
- GH_AW_PR_LABELS: "documentation"
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"labels\":[\"documentation\"],\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[docs] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
diff --git a/.github/workflows/poem-bot.lock.yml b/.github/workflows/poem-bot.lock.yml
index fbb4ed3ede1..b81119a1f3e 100644
--- a/.github/workflows/poem-bot.lock.yml
+++ b/.github/workflows/poem-bot.lock.yml
@@ -1765,11 +1765,8 @@ jobs:
outputs:
create_agent_task_task_number: ${{ steps.create_agent_task.outputs.task_number }}
create_agent_task_task_url: ${{ steps.create_agent_task.outputs.task_url }}
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
- push_to_pull_request_branch_commit_url: ${{ steps.push_to_pull_request_branch.outputs.commit_url }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1822,7 +1819,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":3,\"target\":\"*\"},\"add_labels\":{\"allowed\":[\"poetry\",\"creative\",\"automation\",\"ai-generated\",\"epic\",\"haiku\",\"sonnet\",\"limerick\"],\"max\":5},\"create_discussion\":{\"category\":\"General\",\"close_older_discussions\":true,\"labels\":[\"poetry\",\"automation\",\"ai-generated\"],\"max\":2,\"title_prefix\":\"[📜 POETRY] \"},\"create_issue\":{\"labels\":[\"poetry\",\"automation\",\"ai-generated\"],\"max\":2,\"title_prefix\":\"[🎭 POEM-BOT] \"},\"create_pull_request_review_comment\":{\"max\":2,\"side\":\"RIGHT\"},\"link_sub_issue\":{\"max\":3,\"parent_required_labels\":[\"poetry\",\"epic\"],\"parent_title_prefix\":\"[🎭 POEM-BOT]\",\"sub_required_labels\":[\"poetry\"],\"sub_title_prefix\":\"[🎭 POEM-BOT]\"},\"update_issue\":{\"allow_body\":true,\"allow_status\":true,\"allow_title\":true,\"max\":2,\"target\":\"*\"}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":3,\"target\":\"*\"},\"add_labels\":{\"allowed\":[\"poetry\",\"creative\",\"automation\",\"ai-generated\",\"epic\",\"haiku\",\"sonnet\",\"limerick\"],\"max\":5},\"close_pull_request\":{\"max\":2,\"required_labels\":[\"poetry\",\"automation\"],\"required_title_prefix\":\"[🎨 POETRY]\",\"target\":\"*\"},\"create_discussion\":{\"category\":\"General\",\"close_older_discussions\":true,\"labels\":[\"poetry\",\"automation\",\"ai-generated\"],\"max\":2,\"title_prefix\":\"[📜 POETRY] \"},\"create_issue\":{\"labels\":[\"poetry\",\"automation\",\"ai-generated\"],\"max\":2,\"title_prefix\":\"[🎭 POEM-BOT] \"},\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"max\":1,\"max_patch_size\":1024},\"create_pull_request_review_comment\":{\"max\":2,\"side\":\"RIGHT\"},\"link_sub_issue\":{\"max\":3,\"parent_required_labels\":[\"poetry\",\"epic\"],\"parent_title_prefix\":\"[🎭 POEM-BOT]\",\"sub_required_labels\":[\"poetry\"],\"sub_title_prefix\":\"[🎭 POEM-BOT]\"},\"push_to_pull_request_branch\":{\"base_branch\":\"${{ github.ref_name }}\",\"if_no_changes\":\"warn\",\"max_patch_size\":1024},\"update_issue\":{\"allow_body\":true,\"allow_status\":true,\"allow_title\":true,\"max\":2,\"target\":\"*\"}}"
GH_AW_SAFE_OUTPUTS_STAGED: "true"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
@@ -1831,57 +1828,6 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
- GH_AW_COMMENT_ID: ${{ needs.activation.outputs.comment_id }}
- GH_AW_COMMENT_REPO: ${{ needs.activation.outputs.comment_repo }}
- GH_AW_SAFE_OUTPUTS_STAGED: "true"
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
- await main();
- - name: Close Pull Request
- id: close_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'close_pull_request'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_STAGED: "true"
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/close_pull_request.cjs');
- await main();
- - name: Push To Pull Request Branch
- id: push_to_pull_request_branch
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'push_to_pull_request_branch'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_PUSH_IF_NO_CHANGES: "warn"
- GH_AW_MAX_PATCH_SIZE: 1024
- GH_AW_SAFE_OUTPUTS_STAGED: "true"
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/push_to_pull_request_branch.cjs');
- await main();
- name: Create Agent Task
id: create_agent_task
if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_agent_task'))
diff --git a/.github/workflows/q.lock.yml b/.github/workflows/q.lock.yml
index e0f6ca15825..95add7546f2 100644
--- a/.github/workflows/q.lock.yml
+++ b/.github/workflows/q.lock.yml
@@ -1686,8 +1686,6 @@ jobs:
GH_AW_WORKFLOW_ID: "q"
GH_AW_WORKFLOW_NAME: "Q"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
@@ -1742,7 +1740,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"max\":1,\"max_patch_size\":1024}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
@@ -1750,26 +1748,6 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
- GH_AW_COMMENT_ID: ${{ needs.activation.outputs.comment_id }}
- GH_AW_COMMENT_REPO: ${{ needs.activation.outputs.comment_repo }}
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
- await main();
update_cache_memory:
needs:
diff --git a/.github/workflows/security-fix-pr.lock.yml b/.github/workflows/security-fix-pr.lock.yml
index c3b6d700fb9..8e4434402d7 100644
--- a/.github/workflows/security-fix-pr.lock.yml
+++ b/.github/workflows/security-fix-pr.lock.yml
@@ -1321,8 +1321,8 @@ jobs:
GH_AW_WORKFLOW_ID: "security-fix-pr"
GH_AW_WORKFLOW_NAME: "Security Fix PR"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1370,23 +1370,18 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"max\":1,\"max_patch_size\":1024}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
update_cache_memory:
diff --git a/.github/workflows/slide-deck-maintainer.lock.yml b/.github/workflows/slide-deck-maintainer.lock.yml
index acfe73d3820..2ebf1d4f586 100644
--- a/.github/workflows/slide-deck-maintainer.lock.yml
+++ b/.github/workflows/slide-deck-maintainer.lock.yml
@@ -1404,8 +1404,8 @@ jobs:
GH_AW_WORKFLOW_ID: "slide-deck-maintainer"
GH_AW_WORKFLOW_NAME: "Slide Deck Maintainer"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1453,25 +1453,18 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[slides] "
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
- GH_AW_PR_EXPIRES: "24"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"expires\":24,\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[slides] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
update_cache_memory:
diff --git a/.github/workflows/smoke-codex-firewall.lock.yml b/.github/workflows/smoke-codex-firewall.lock.yml
index cd0d08be158..daa662c6998 100644
--- a/.github/workflows/smoke-codex-firewall.lock.yml
+++ b/.github/workflows/smoke-codex-firewall.lock.yml
@@ -1201,7 +1201,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"hide_older_comments\":true,\"max\":1},\"add_labels\":{\"allowed\":[\"smoke-codex-firewall\"]},\"create_issue\":{\"expires\":2,\"max\":1}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"hide_older_comments\":true,\"max\":1},\"add_labels\":{\"allowed\":[\"smoke-codex-firewall\"]},\"create_issue\":{\"expires\":2,\"max\":1},\"hide_comment\":{\"max\":5}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
@@ -1209,17 +1209,4 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Hide Comment
- id: hide_comment
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'hide_comment'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/hide_comment.cjs');
- await main();
diff --git a/.github/workflows/smoke-codex.lock.yml b/.github/workflows/smoke-codex.lock.yml
index 5d96849b130..5bafd90d90f 100644
--- a/.github/workflows/smoke-codex.lock.yml
+++ b/.github/workflows/smoke-codex.lock.yml
@@ -1295,7 +1295,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"hide_older_comments\":true,\"max\":1},\"add_labels\":{\"allowed\":[\"smoke-codex\"]},\"create_issue\":{\"expires\":2,\"max\":1}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"hide_older_comments\":true,\"max\":1},\"add_labels\":{\"allowed\":[\"smoke-codex\"]},\"create_issue\":{\"expires\":2,\"max\":1},\"hide_comment\":{\"max\":5}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
@@ -1303,19 +1303,6 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Hide Comment
- id: hide_comment
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'hide_comment'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/hide_comment.cjs');
- await main();
update_cache_memory:
needs:
diff --git a/.github/workflows/spec-kit-execute.lock.yml b/.github/workflows/spec-kit-execute.lock.yml
index 6aa8a12be84..b34c8a62c0a 100644
--- a/.github/workflows/spec-kit-execute.lock.yml
+++ b/.github/workflows/spec-kit-execute.lock.yml
@@ -1567,8 +1567,8 @@ jobs:
GH_AW_WORKFLOW_ID: "spec-kit-execute"
GH_AW_WORKFLOW_NAME: "Spec-Kit Execute"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1616,23 +1616,18 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"max\":1,\"max_patch_size\":1024}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
update_cache_memory:
diff --git a/.github/workflows/spec-kit-executor.lock.yml b/.github/workflows/spec-kit-executor.lock.yml
index 6a3234d82d3..11c9ea9cb3d 100644
--- a/.github/workflows/spec-kit-executor.lock.yml
+++ b/.github/workflows/spec-kit-executor.lock.yml
@@ -1413,8 +1413,8 @@ jobs:
GH_AW_WORKFLOW_ID: "spec-kit-executor"
GH_AW_WORKFLOW_NAME: "Spec Kit Executor"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1462,23 +1462,18 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"max\":1,\"max_patch_size\":1024}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
update_cache_memory:
diff --git a/.github/workflows/technical-doc-writer.lock.yml b/.github/workflows/technical-doc-writer.lock.yml
index 170e6f69fdf..43c0460d85d 100644
--- a/.github/workflows/technical-doc-writer.lock.yml
+++ b/.github/workflows/technical-doc-writer.lock.yml
@@ -1576,8 +1576,6 @@ jobs:
GH_AW_WORKFLOW_ID: "technical-doc-writer"
GH_AW_WORKFLOW_NAME: "Technical Doc Writer"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
@@ -1632,7 +1630,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"max\":1,\"max_patch_size\":1024}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
@@ -1640,24 +1638,6 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
- await main();
update_cache_memory:
needs:
diff --git a/.github/workflows/tidy.lock.yml b/.github/workflows/tidy.lock.yml
index 0791aed5b76..da63d3a5310 100644
--- a/.github/workflows/tidy.lock.yml
+++ b/.github/workflows/tidy.lock.yml
@@ -1257,9 +1257,8 @@ jobs:
GH_AW_WORKFLOW_ID: "tidy"
GH_AW_WORKFLOW_NAME: "Tidy"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
- push_to_pull_request_branch_commit_url: ${{ steps.push_to_pull_request_branch.outputs.commit_url }}
+ process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
+ process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -1307,39 +1306,17 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
+ - name: Process Safe Outputs
+ id: process_safe_outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
- GH_AW_COMMENT_ID: ${{ needs.activation.outputs.comment_id }}
- GH_AW_COMMENT_REPO: ${{ needs.activation.outputs.comment_repo }}
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
- await main();
- - name: Push To Pull Request Branch
- id: push_to_pull_request_branch
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'push_to_pull_request_branch'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_PUSH_IF_NO_CHANGES: "warn"
- GH_AW_MAX_PATCH_SIZE: 1024
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"max\":1,\"max_patch_size\":1024},\"push_to_pull_request_branch\":{\"base_branch\":\"${{ github.ref_name }}\",\"if_no_changes\":\"warn\",\"max_patch_size\":1024}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/push_to_pull_request_branch.cjs');
+ const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
diff --git a/.github/workflows/unbloat-docs.lock.yml b/.github/workflows/unbloat-docs.lock.yml
index 60ed698ca8c..be0545eb70a 100644
--- a/.github/workflows/unbloat-docs.lock.yml
+++ b/.github/workflows/unbloat-docs.lock.yml
@@ -1632,8 +1632,6 @@ jobs:
GH_AW_WORKFLOW_ID: "unbloat-docs"
GH_AW_WORKFLOW_NAME: "Documentation Unbloat"
outputs:
- create_pull_request_pull_request_number: ${{ steps.create_pull_request.outputs.pull_request_number }}
- create_pull_request_pull_request_url: ${{ steps.create_pull_request.outputs.pull_request_url }}
process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
steps:
@@ -1688,7 +1686,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1}}"
+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"draft\":true,\"labels\":[\"documentation\",\"automation\"],\"max\":1,\"max_patch_size\":1024,\"title_prefix\":\"[docs] \"}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
@@ -1696,28 +1694,6 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/safe_output_handler_manager.cjs');
await main();
- - name: Create Pull Request
- id: create_pull_request
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_BASE_BRANCH: ${{ github.ref_name }}
- GH_AW_PR_TITLE_PREFIX: "[docs] "
- GH_AW_PR_LABELS: "documentation,automation"
- GH_AW_PR_DRAFT: "true"
- GH_AW_PR_IF_NO_CHANGES: "warn"
- GH_AW_PR_ALLOW_EMPTY: "false"
- GH_AW_MAX_PATCH_SIZE: 1024
- GH_AW_COMMENT_ID: ${{ needs.activation.outputs.comment_id }}
- GH_AW_COMMENT_REPO: ${{ needs.activation.outputs.comment_repo }}
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/tmp/gh-aw/actions/create_pull_request.cjs');
- await main();
update_cache_memory:
needs:
diff --git a/actions/setup/js/close_pull_request.cjs b/actions/setup/js/close_pull_request.cjs
index f293beec87d..e5c59a90e54 100644
--- a/actions/setup/js/close_pull_request.cjs
+++ b/actions/setup/js/close_pull_request.cjs
@@ -1,7 +1,13 @@
// @ts-check
///
-const { processCloseEntityItems, PULL_REQUEST_CONFIG } = require("./close_entity_helpers.cjs");
+const { getErrorMessage } = require("./error_helpers.cjs");
+
+/**
+ * @typedef {import('./types/handler-factory').HandlerFactoryFunction} HandlerFactoryFunction
+ */
+
+const HANDLER_TYPE = "close_pull_request";
/**
* Get pull request details using REST API
@@ -64,12 +70,201 @@ async function closePullRequest(github, owner, repo, prNumber) {
return pr;
}
-async function main() {
- return processCloseEntityItems(PULL_REQUEST_CONFIG, {
- getDetails: getPullRequestDetails,
- addComment: addPullRequestComment,
- closeEntity: closePullRequest,
- });
+/**
+ * Handler factory for close-pull-request safe outputs
+ * @type {HandlerFactoryFunction}
+ */
+async function main(config = {}) {
+ // Extract configuration
+ const requiredLabels = config.required_labels || [];
+ const requiredTitlePrefix = config.required_title_prefix || "";
+ const maxCount = config.max || 10;
+ const comment = config.comment || "";
+
+ core.info(`Close pull request configuration: max=${maxCount}`);
+ if (requiredLabels.length > 0) {
+ core.info(`Required labels: ${requiredLabels.join(", ")}`);
+ }
+ if (requiredTitlePrefix) {
+ core.info(`Required title prefix: ${requiredTitlePrefix}`);
+ }
+
+ // Track how many items we've processed for max limit
+ let processedCount = 0;
+
+ /**
+ * Message handler function that processes a single close_pull_request message
+ * @param {Object} message - The close_pull_request message to process
+ * @param {Object} resolvedTemporaryIds - Map of temporary IDs to {repo, number}
+ * @returns {Promise