[llvm-branch-commits] [Github] Make issue-write workflow support reading from multiple files (PR #170411)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Dec 2 18:48:02 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-github-workflow
Author: Aiden Grossman (boomanaiden154)
<details>
<summary>Changes</summary>
This is so that we can read from multiple files emitted by the premerge
workflow.
---
Full diff: https://github.com/llvm/llvm-project/pull/170411.diff
2 Files Affected:
- (modified) .github/workflows/issue-write-test.yaml (+10-3)
- (modified) .github/workflows/issue-write.yml (+6-1)
``````````diff
diff --git a/.github/workflows/issue-write-test.yaml b/.github/workflows/issue-write-test.yaml
index 9497e719e35b1..8fae346038680 100644
--- a/.github/workflows/issue-write-test.yaml
+++ b/.github/workflows/issue-write-test.yaml
@@ -16,10 +16,17 @@ jobs:
steps:
- name: Write Comment
run: |
- echo '[{"body": "This is a comment for testing the issue write workflow"}]' > comments
+ echo '[{"body": "This is a comment for testing the issue write workflow"}]' > comments-foo
+ echo '[{"body": "This is another comment for testing the issue write workflow that was placed in a separate file"}]' > comments-bar
- name: Upload Comment
uses: actions/upload-artifact at 330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
- name: workflow-args
+ name: workflow-args-foo
path: |
- comments
+ comments-foo
+ - name: Upload Comment
+ uses: actions/upload-artifact at 330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
+ with:
+ name: workflow-args-bar
+ path: |
+ comments-bar
diff --git a/.github/workflows/issue-write.yml b/.github/workflows/issue-write.yml
index ac75dffd8b3b8..9ceadbe971093 100644
--- a/.github/workflows/issue-write.yml
+++ b/.github/workflows/issue-write.yml
@@ -47,7 +47,12 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
- const comments = JSON.parse(fs.readFileSync('./comments'));
+ var comments = []
+ for (local_file of fs.readdirSync('.')) {
+ if (local_file.startsWith("comments")) {
+ comments.push(...JSON.parse(fs.readFileSync(local_file)))
+ }
+ }
if (!comments || comments.length == 0) {
return;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/170411
More information about the llvm-branch-commits
mailing list