This is an automated email from the ASF dual-hosted git repository.

erikrit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new c7618ee  build: add workflow preferring TypeScript files (#9901)
c7618ee is described below

commit c7618ee54b62760ac5f738996379de0dcd5e326e
Author: Erik Ritter <erik.rit...@airbnb.com>
AuthorDate: Mon Jun 1 09:31:31 2020 -0700

    build: add workflow preferring TypeScript files (#9901)
    
    * Add workflow preventing non TypeScript Files
    
    * Create comment_preferring_typescript.md
    
    * Update prevent_non_typescript_files.yml
    
    * Update prevent_non_typescript_files.yml
    
    * Update prevent_non_typescript_files.yml
    
    * Delete comment_preferring_typescript.md
    
    * Create comment_preferring_typescript.md
    
    * Delete comment_preferring_typescript.md
    
    * Update prevent_non_typescript_files.yml
    
    * Update prevent_non_typescript_files.yml
    
    * Update prevent_non_typescript_files.yml
    
    * Update prevent_non_typescript_files.yml
    
    * Update prevent_non_typescript_files.yml
    
    * Update prevent_non_typescript_files.yml
    
    * Update prevent_non_typescript_files.yml
    
    * Update prevent_non_typescript_files.yml
    
    * Create test.js
    
    * Delete test.js
    
    * Update prevent_non_typescript_files.yml
    
    * Rename prevent_non_typescript_files.yml to prefer_typescript.yml
    
    * Update prefer_typescript.yml
---
 .github/workflows/prefer_typescript.yml | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/.github/workflows/prefer_typescript.yml 
b/.github/workflows/prefer_typescript.yml
new file mode 100644
index 0000000..79bbfc2
--- /dev/null
+++ b/.github/workflows/prefer_typescript.yml
@@ -0,0 +1,31 @@
+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/file-changes-action@v1.2.3
+        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: |
+            ## 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 and then re-request review.

Reply via email to