You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The printout states that "We are therefore defaulting to use HEAD~1 on 'origin/${mainBranchName}".
However, following statement on line 50: BASE_SHA = execSync(`git rev-parse HEAD~1`, { encoding: 'utf-8' }); queries for HEAD~1on the current branch, instead of specifying the main branch.
(My assumption here that the printed statement is the expected outcome when the action trigger is push and no previous successful run exists).
In addition, if the intention was indeed using the main branch, it seems that using git rev-parse origin/${mainBranchName} or the previously set git merge-base origin/${mainBranchName} HEAD would be preferred.
My workflow configuration for this action is:
name: NX Linton:
push:
jobs:
main:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v2with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.fetch-depth: 0
- uses: actions/setup-node@v2with:
node-version: 16cache: 'yarn'
- uses: nrwl/nx-set-shas@v2with:
main-branch-name: master
- run: yarn install --frozen-lockfile
- run: yarn nx affected --target=lint --parallel=3
The text was updated successfully, but these errors were encountered:
the assumption is that the event is running on the main branch. Of course, this might not be the case if you configured your workflow to be other than (e.g. using tags, listening to events on release, develop etc. branches):
on:
push:
branches:
- mainpull_request:
In practice, it should not make a difference, but using git rev-parse origin/${mainBranchName}~1 would be more accurate.
The code path which attempts to set a default value on
BASE_SHA
(nx-set-shas/find-successful-workflow.js
Lines 44 to 50 in e698d52
The printout states that "We are therefore defaulting to use HEAD~1 on 'origin/${mainBranchName}".
However, following statement on line 50:
BASE_SHA = execSync(`git rev-parse HEAD~1`, { encoding: 'utf-8' });
queries forHEAD~1
on the current branch, instead of specifying the main branch.(My assumption here that the printed statement is the expected outcome when the action trigger is
push
and no previous successful run exists).In addition, if the intention was indeed using the main branch, it seems that using
git rev-parse origin/${mainBranchName}
or the previously setgit merge-base origin/${mainBranchName} HEAD
would be preferred.My workflow configuration for this action is:
The text was updated successfully, but these errors were encountered: