Experimenting with github actions

This commit is contained in:
pietervdvn 2021-04-11 02:49:51 +02:00
parent e741ac5491
commit 8b89be38be

View file

@ -1,6 +1,6 @@
name: Pull request check name: Pull request check
on: on:
pull_request: pull_request_target:
types: [opened, edited, synchronize, ready_for_review, review_requested] types: [opened, edited, synchronize, ready_for_review, review_requested]
jobs: jobs:
@ -32,3 +32,20 @@ jobs:
- name: Validate license info - name: Validate license info
run: npm run validate:licenses 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 }}