mapcomplete/.github/workflows/pull_request_check.yml

52 lines
1.5 KiB
YAML
Raw Normal View History

2021-04-10 15:01:28 +02:00
name: Pull request check
on:
pull_request:
types: [opened, edited, synchronize, ready_for_review, review_requested]
2021-04-11 02:40:46 +02:00
2021-04-10 15:01:28 +02:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1.2.0
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
- name: install deps
run: npm install
- name: create generated dir
run: mkdir ./assets/generated
- name: create stub themes
run: "echo '{\"layers\": [], \"themes\": []}' > ./assets/generated/known_layers_and_themes.json"
2021-04-10 16:18:29 +02:00
- name: Compile license info
2021-04-10 16:20:40 +02:00
run: npm run generate:licenses
2021-04-10 15:01:28 +02:00
2021-04-10 16:18:29 +02:00
- name: Compile and validate themes and layers
2021-04-10 16:06:01 +02:00
run: npm run validate:layeroverview
2021-04-10 16:20:40 +02:00
- name: Validate license info
run: npm run validate:licenses
2021-04-11 01:58:51 +02:00
- 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
2021-04-11 02:30:57 +02:00
run: echo "${{ env.VALIDATION_FAILED }}"
- name: Comment PR
uses: allthatjazzleo/actions-pull-request-add-comment@master
if: >-
env.VALIDATION_FAILED == 'true'
with:
# message: 'yoyo🤙🏻'
message: "cat layer_report.txt missing_licenses.txt"
2021-04-11 02:40:46 +02:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}