Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use base SHA instead of base branch since the base branch #2

Merged
merged 8 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/aviator-targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,38 @@ on:
pull_request:

jobs:
nextjs-build:
fetch-aviator-targets:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v4
with:
# using partial clone to make sure we fetch what we need
# when comparing base and head.
filter: 'blob:none'
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '18'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot comment on the exact line, but on line 13, add

with:
  filter: 'blob:none'
  depth: 0

cache: 'yarn'
- run: yarn install
- uses: octokit/[email protected]
id: get_pr
with:
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.number }}
owner: octokit
repo: request-action
env:
GITHUB_TOKEN: ${{ github.token }}

- 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)
TARGETS_JSON=$(npx nx show projects --affected --base ${{ fromJson(steps.get_pr.outputs.data).base.sha }} --head ${{ github.sha }} --json)
echo $TARGETS_JSON
echo latest sha: '${{ fromJson(steps.get_pr.outputs.data).base.sha }}'
curl -X POST -H "Authorization: Bearer ${{ secrets.AVIATOR_API_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useReducer } from 'react';

import styled from '@emotion/styled';

import '@nx-example/shared/product/ui';
Expand Down
Loading