forked from nrwl/nx-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 1.07 KB
/
aviator-targets.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Fetch Aviator targets
on:
pull_request:
jobs:
nextjs-build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'
cache-dependency-path: ./yarn.lock
- run: yarn install --immutable
- run: |
set -euo pipefail
git fetch origin $GITHUB_BASE_REF
PR_NUMBER=${{ github.event.number }}
TARGETS_JSON=$(npx nx show projects --affected --base FETCH_HEAD --head HEAD --json)
echo $TARGETS_JSON
curl -X POST -H "Authorization: Bearer ${{ secrets.AVIATOR_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{
"action": "update",
"pull_request": {
"number": '"$PR_NUMBER"',
"repository": {"name": "aviator-co", "org": "nx-examples"},
"affected_targets": '"$TARGETS_JSON"'
}
}' https://api.aviator.co/api/v1/pull_request/