From 8b89be38be4a97b940bc1e83a917d4a30941a239 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Sun, 11 Apr 2021 02:49:51 +0200 Subject: [PATCH] Experimenting with github actions --- .github/workflows/pull_request_check.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request_check.yml b/.github/workflows/pull_request_check.yml index 2638d54..fa06b32 100644 --- a/.github/workflows/pull_request_check.yml +++ b/.github/workflows/pull_request_check.yml @@ -1,6 +1,6 @@ name: Pull request check on: - pull_request: + pull_request_target: types: [opened, edited, synchronize, ready_for_review, review_requested] jobs: @@ -32,3 +32,20 @@ jobs: - name: Validate license info run: npm run validate:licenses + + - name: Set failure key + run: | + if [[ -f "layer_report.txt" || -f "missing_licenses.txt" ]]; then + echo "VALIDATION_FAILED=true" >>$GITHUB_ENV + fi + + - name: Test variable + run: echo "${{ env.VALIDATION_FAILED }}" + + - name: Comment PR + uses: allthatjazzleo/actions-pull-request-add-comment@master + if: >- + env.VALIDATION_FAILED == 'true' + with: + message: "cat layer_report.txt missing_licenses.txt" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file