2023-01-03 19:55:46 +00:00
|
|
|
# Copyright 2020 Signal Messenger, LLC
|
2022-09-16 18:32:28 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2023-11-02 19:42:31 +00:00
|
|
|
name: Danger
|
2022-09-16 18:32:28 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
danger:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
2024-06-27 21:48:40 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-09-16 18:32:28 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0 # fetch all history
|
2024-06-27 21:48:40 +00:00
|
|
|
- name: Setup node.js
|
|
|
|
uses: actions/setup-node@v4
|
2022-09-16 18:32:28 +00:00
|
|
|
with:
|
2024-06-27 21:48:40 +00:00
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: 'package-lock.json'
|
2024-06-24 20:14:32 +00:00
|
|
|
- run: npm install -g npm@10.2.5
|
2022-09-16 18:32:28 +00:00
|
|
|
- name: Cache danger node_modules
|
|
|
|
id: cache-desktop-modules
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: danger/node_modules
|
2024-06-24 20:14:32 +00:00
|
|
|
key: danger-${{ runner.os }}-${{ hashFiles('danger/package.json', 'danger/package-lock.json') }}
|
2022-09-16 18:32:28 +00:00
|
|
|
- name: Install danger node_modules
|
|
|
|
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
|
2024-06-25 02:59:26 +00:00
|
|
|
run: cd danger && npm ci
|
2022-09-16 18:32:28 +00:00
|
|
|
- name: Run DangerJS
|
2024-06-24 20:14:32 +00:00
|
|
|
run: npm run danger:ci
|
2022-09-16 18:32:28 +00:00
|
|
|
env:
|
|
|
|
DANGER_GITHUB_API_TOKEN: ${{ secrets.AUTOMATED_GITHUB_PAT }}
|