kou commented on code in PR #44818:
URL: https://github.com/apache/arrow/pull/44818#discussion_r1855319966
##########
.github/workflows/issue_bot.yml:
##########
@@ -24,17 +24,21 @@ on:
permissions:
contents: read
- issues: write
jobs:
label_components:
name: Label Components
if: github.event.issue.pull_request == null
runs-on: ubuntu-latest
+ permissions:
+ issues: write
steps:
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #
v7.0.1
with:
script: |
+ let repo_moved_msg = component => `The ${component} implementation
has moved to https://github.com/apache/arrow-${component}.` +
+ "\nPlease close this one and open your issue there.";
Review Comment:
It seems that `\n` didn't work:
https://github.com/assignUser/arrow/issues/23#issuecomment-2495308407
##########
.github/workflows/issue_bot.yml:
##########
@@ -52,10 +56,24 @@ jobs:
label => !label.startsWith("Component: ")
);
- let component_labels = split_body[1]
+ let components = split_body[1]
.split(',')
- .map(component => component.trim())
- .map(component => "Component: " + component);
+ .map(component => component.trim());
+ let moved_components = components.filter(comp =>
["Go"].includes(comp));
Review Comment:
How about using `find` not `filter` because this only uses the first found
component?
##########
.github/workflows/issue_bot.yml:
##########
@@ -24,17 +24,21 @@ on:
permissions:
contents: read
- issues: write
jobs:
label_components:
name: Label Components
if: github.event.issue.pull_request == null
runs-on: ubuntu-latest
+ permissions:
+ issues: write
steps:
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #
v7.0.1
with:
script: |
+ let repo_moved_msg = component => `The ${component} implementation
has moved to https://github.com/apache/arrow-${component}.` +
Review Comment:
```suggestion
let repo_moved_msg = component => `The ${component}
implementation has moved to
https://github.com/apache/arrow-${component.toLowerCase}.` +
```
##########
.github/workflows/issue_bot.yml:
##########
@@ -52,10 +56,24 @@ jobs:
label => !label.startsWith("Component: ")
);
- let component_labels = split_body[1]
+ let components = split_body[1]
.split(',')
- .map(component => component.trim())
- .map(component => "Component: " + component);
+ .map(component => component.trim());
+ let moved_components = components.filter(comp =>
["Go"].includes(comp));
+
+ if (moved_components.length != 0){
Review Comment:
```suggestion
if (moved_components.length != 0) {
```
##########
.github/workflows/issue_bot.yml:
##########
@@ -52,10 +56,24 @@ jobs:
label => !label.startsWith("Component: ")
);
- let component_labels = split_body[1]
+ let components = split_body[1]
.split(',')
- .map(component => component.trim())
- .map(component => "Component: " + component);
+ .map(component => component.trim());
+ let moved_components = components.filter(comp =>
["Go"].includes(comp));
+
+ if (moved_components.length != 0){
+ await github.rest.issues.createComment({
+ "owner": context.repo.owner,
+ "repo": context.repo.repo,
+ "issue_number": context.payload.issue.number,
+ "body": repo_moved_msg(moved_components[0]),
+ });
+ console.log("blub")
Review Comment:
```suggestion
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]