nytai commented on a change in pull request #12090:
URL: https://github.com/apache/superset/pull/12090#discussion_r552961666



##########
File path: .github/workflows/misc.yml
##########
@@ -0,0 +1,91 @@
+name: Miscellaneous
+
+on:
+  push:
+    branches-ignore:
+      - "dependabot/**"
+  pull_request:
+
+jobs:
+  license_check:
+    name: License Check
+    runs-on: ubuntu-18.04
+    steps:
+      - uses: actions/checkout@v2
+      - name: Setup Java
+        uses: actions/setup-java@v1
+        with:
+          java-version: 8
+      - name: Generate fossa report
+        env:
+          FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
+        run: |
+          set -eo pipefail
+          if [[ "${{github.event_name}}" != "pull_request" ]]; then
+            ./scripts/fossa.sh
+            exit 0
+          fi
+
+          URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ 
github.event.pull_request.number }}/files"
+          FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename')
+
+          cat<<EOF
+          CHANGED FILES:
+          $FILES
+
+          EOF
+
+          if [[ "${FILES}" =~ 
(.*package*\.json|requirements\/[a-z_-]+\.txt|setup\.py) ]]; then
+            echo "Detected dependency changes... running fossa check"
+
+            ./scripts/fossa.sh
+          else
+            echo "No dependency changes... skiping fossa check"
+          fi
+        shell: bash
+      - name: Run license check
+        run: ./scripts/check_license.sh
+
+  prefer_typescript:
+    if: github.ref == 'ref/heads/master' && github.event_name == 'pull_request'
+    name: Prefer Typescript
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Get changed files
+        id: changed
+        uses: ./.github/actions/file-changes-action
+        with:
+          githubToken: ${{ secrets.GITHUB_TOKEN }}
+
+      - name: Determine if a .js or .jsx file was added
+        id: check
+        run: |
+          js_files_added() {
+            jq -r '
+              map(
+                select(
+                  endswith(".js") or endswith(".jsx")
+                )
+              ) | join("\n")
+            ' ${HOME}/files_added.json
+          }
+          echo ::set-output name=js_files_added::$(js_files_added)
+
+      - if: steps.check.outputs.js_files_added
+        name: Add Comment to PR
+        uses: ./.github/actions/comment-on-pr
+        continue-on-error: true
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:

Review comment:
       This check is essentially useless since the comments will never work for 
PRs coming from forks (due to the GITHUB_TOKEN access). This would be a good 
candidate to port over to the `workflow_run` approach mentioned in 
https://securitylab.github.com/research/github-actions-preventing-pwn-requests. 
Obviously, out of scope for this 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