Xuanwo commented on code in PR #6267:
URL: https://github.com/apache/arrow-rs/pull/6267#discussion_r1723329758


##########
.github/workflows/take.yml:
##########
@@ -25,17 +25,16 @@ permissions:
 
 jobs:
   issue_assign:
-    runs-on: ubuntu-latest
     if: (!github.event.issue.pull_request) && github.event.comment.body == 
'take'
-    concurrency:
-      group: ${{ github.actor }}-issue-assign
+    runs-on: ubuntu-latest
     steps:
-      - run: |
-          CODE=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" 
-LI https://api.github.com/repos/${{ github.repository }}/issues/${{ 
github.event.issue.number }}/assignees/${{ github.event.comment.user.login }} 
-o /dev/null -w '%{http_code}\n' -s)
-          if [ "$CODE" -eq "204" ]
-          then
-            echo "Assigning issue ${{ github.event.issue.number }} to ${{ 
github.event.comment.user.login }}"
-            curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d 
'{"assignees": ["${{ github.event.comment.user.login }}"]}' 
https://api.github.com/repos/${{ github.repository }}/issues/${{ 
github.event.issue.number }}/assignees
-          else
-            echo "Cannot assign issue ${{ github.event.issue.number }} to ${{ 
github.event.comment.user.login }}"
-          fi
\ No newline at end of file
+      - uses: actions/checkout@v4
+      - uses: actions/setup-node@v4
+        with:
+          node-version: 20
+      - run: npm install @octokit/action
+      - run: node .github/actions/assign.mjs

Review Comment:
   Compared to having our own implemented `assign.mjs`, I prefer using safer 
options like https://github.com/actions/github-script. It's easier to maintain 
and review.
   
   What do you think?



-- 
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]

Reply via email to