Skip to content

Commit

Permalink
Add GitHub action to upload target information to Aviator (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviator-app[bot] authored Dec 2, 2023
2 parents d0e1277 + fa31905 commit db4ad29
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/aviator-targets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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'
- run: yarn install
- 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_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"action": "update",
"pull_request": {
"number": '"$PR_NUMBER"',
"repository": {"name": "nx-examples", "org": "aviator-co"},
"affected_targets": '"$TARGETS_JSON"'
}
}' https://api.aviator.co/api/v1/pull_request/
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { cleanup, fireEvent, render } from '@testing-library/react';


import CartCartPage from './cart-cart-page';

describe(' CartCartPage', () => {
Expand Down

0 comments on commit db4ad29

Please sign in to comment.