ktmud commented on a change in pull request #9901:
URL: 
https://github.com/apache/incubator-superset/pull/9901#discussion_r430032832



##########
File path: .github/workflows/prefer_typescript.yml
##########
@@ -0,0 +1,28 @@
+name: Prefer TypeScript
+
+on:
+  pull_request:
+    branches:
+      - master
+
+jobs:
+  comment:
+    name: Comment about preferring TypeScript
+    runs-on: ubuntu-latest
+    steps:
+      - name: Get changed files
+        id: changed
+        uses: trilom/[email protected]
+        with:
+          githubToken: ${{ secrets.GITHUB_TOKEN }}
+      - name: Determine if a .js or .jsx file was added
+        id: check
+        run: |
+          echo ::set-output name=was_js_file_added::$(jq 'map(endswith(".js") 
or endswith(".jsx"))' ${HOME}/files_added.json | jq 'reduce .[] as $is_js 
(false; . or $is_js)')
+      - if: steps.check.outputs.was_js_file_added != 'false'
+        name: Comment about preferring TypeScript
+        uses: unsplash/comment-on-pr@master
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          msg: "It looks like your PR contains new `.js` or `.jsx` files. As 
decided in [SIP-36](https://github.com/apache/incubator-superset/issues/9101), 
all new files should be written in TypeScript. Please convert new JavaScript 
files to TypeScript and then re-request review."

Review comment:
       How about a title to make this more visible 
   
   ```
           with:
             msg: |
               ## WARNING: TypeScript Preferred
   
               It looks like your PR contains new `.js` or `.jsx` files. As 
decided in [SIP-36](https://github.com/apache/incubator-superset/issues/9101), 
all new files should be written in TypeScript.
   
               Please convert new JavaScript files to TypeScript (`.ts` or 
`tsx`) then re-request review.
   ```
   
   ---
   
   ## WARNING: Prefer TypeScript
   
   It looks like your PR contains new `.js` or `.jsx` files. As decided in 
[SIP-36](https://github.com/apache/incubator-superset/issues/9101), all new 
files should be written in TypeScript. Please convert new JavaScript files to 
TypeScript then re-request review.
   
   ---
   
   It'd also be nice if the comment could be deleted when new `js` was removed 
from PR.

##########
File path: .github/workflows/prefer_typescript.yml
##########
@@ -0,0 +1,28 @@
+name: Prefer TypeScript
+
+on:
+  pull_request:
+    branches:
+      - master
+
+jobs:
+  comment:
+    name: Comment about preferring TypeScript
+    runs-on: ubuntu-latest
+    steps:
+      - name: Get changed files
+        id: changed
+        uses: trilom/[email protected]
+        with:
+          githubToken: ${{ secrets.GITHUB_TOKEN }}
+      - name: Determine if a .js or .jsx file was added
+        id: check
+        run: |
+          echo ::set-output name=was_js_file_added::$(jq 'map(endswith(".js") 
or endswith(".jsx"))' ${HOME}/files_added.json | jq 'reduce .[] as $is_js 
(false; . or $is_js)')
+      - if: steps.check.outputs.was_js_file_added != 'false'
+        name: Comment about preferring TypeScript
+        uses: unsplash/comment-on-pr@master
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          msg: "It looks like your PR contains new `.js` or `.jsx` files. As 
decided in [SIP-36](https://github.com/apache/incubator-superset/issues/9101), 
all new files should be written in TypeScript. Please convert new JavaScript 
files to TypeScript and then re-request review."

Review comment:
       How about a title to make this more visible 
   
   ```
           with:
             msg: |
               ## WARNING: TypeScript Preferred
   
               It looks like your PR contains new `.js` or `.jsx` files. As 
decided in [SIP-36](https://github.com/apache/incubator-superset/issues/9101), 
all new files should be written in TypeScript. Please convert new JavaScript 
files to TypeScript (`.ts` or `tsx`) then re-request review.
   ```
   
   ---
   
   ## WARNING: Prefer TypeScript
   
   It looks like your PR contains new `.js` or `.jsx` files. As decided in 
[SIP-36](https://github.com/apache/incubator-superset/issues/9101), all new 
files should be written in TypeScript. Please convert new JavaScript files to 
TypeScript then re-request review.
   
   ---
   
   It'd also be nice if the comment could be deleted when new `js` was removed 
from PR.




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to