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
Our CI began failing during yarn version check with the following error:
YN0001: UsageError: No ancestor could be found between any of HEAD and packages/publish, origin/packages/publish, upstream/packages/publish
It's been a while since this was last run, but it was confirmed working on Sep 22, 2022 and no significant changes were made to our Github Actions workflow since.
Executing the command locally produces no errors. The workflow file was also run successfully using https://github.com/nektos/act, which pulls down the necessary images and claims to be configured to match Github's system.
To reproduce
We have not been able to reproduce outside of Github Actions.
name: Package - Open PRon:
pull_request:
types: [opened, synchronize, reopened]paths:
- 'packages/{MY_PACKAGE}/**'jobs:
validate-package:
runs-on: ubuntu-latestcontainer:
image: node:16steps:
- uses: actions/checkout@v2with:
fetch-depth: 0
- name: Get yarn cache directory pathid: yarn-cache-dir-pathrun: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2id: yarn-cachewith:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}key: yarn-${{ hashFiles('**/yarn.lock') }}restore-keys: | yarn-
- name: yarn installshell: bashrun: yarn installenv:
YARN_NPM_AUTH_TOKEN: ${{ secrets.YARN_TOKEN }}
- name: yarn run testshell: bashrun: yarn workspace MY_WORKSPACE run test
- name: yarn run lintshell: bashrun: yarn workspace MY_WORKSPACE run lint
- name: yarn run buildshell: bashrun: yarn workspace MY_WORKSPACE run build
- name: yarn version checkshell: bashrun: yarn version check
Environment
Github Actions
- Image: ubuntu-22.04 (latest)
- Image Version: 20230217.1
- Node: 16.19.1
- Yarn: 3.3.1
The .yarn/** and .yarnrc.yml files are committed to our repo, so the yarn version is consistent across our CI and dev environments.
Additional context
We use this workflow to validate that our Github package updates are properly versioned before being published.
I've experienced the same issue using different runner images (ubuntu-20.04, ubuntu-18.04) and an older version of yarn (3.2.1)
Failure log example:
Run yarn version check
➤ YN0001: UsageError: No ancestor could be found between any of HEAD and packages/publish, origin/packages/publish, upstream/packages/publish
at Object.MAe (/__w/project/.yarn/releases/yarn-3.3.1.cjs:593:8009)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async $v (/__w/project/.yarn/plugins/@yarnpkg/plugin-version.cjs:433:8625)
at async /__w/project/.yarn/plugins/@yarnpkg/plugin-version.cjs:446:10281
at async Function.start (/__w/project/.yarn/releases/yarn-3.3.1.cjs:409:2347)
at async t_.executeStandard (/__w/project/.yarn/plugins/@yarnpkg/plugin-version.cjs:446:10192)
at async t_.execute (/__w/project/.yarn/plugins/@yarnpkg/plugin-version.cjs:446:3414)
at async t_.validateAndExecute (/__w/project/.yarn/releases/yarn-3.3.1.cjs:63:13148)
at async OA.run (/__w/project/.yarn/releases/yarn-3.3.1.cjs:77:2354)
at async OA.runExit (/__w/project/.yarn/releases/yarn-3.3.1.cjs:77:2538)
➤ YN0000: Failed with errors in 0s 54ms
Error: Process completed with exit code 1.
Some things I've tried:
Cleared/disabled all CI caches and ran yarn install from scratch
Updated to the latest Github actions (i.e. actions/checkout@v3), ruled out issues with fetch-depth, etc.
Tried running the workflow on different branches
The text was updated successfully, but these errors were encountered:
I determined this is not an issue with Yarn itself, but with actions/checkout. Checkout is not correctly adding the repository to git's safe directory list when run inside a container, as observed here: actions/checkout#1169. My understanding is yarn version check uses git diff to evaluate changes, which is likely failing internally with "fatal: detected dubious ownership..."
Following checkout with git config --system --add safe.directory <path> did unblock us. I hope this helps anyone else experiencing similar issues. Closing as resolved.
Self-service
Describe the bug
Our CI began failing during
yarn version check
with the following error:It's been a while since this was last run, but it was confirmed working on Sep 22, 2022 and no significant changes were made to our Github Actions workflow since.
Executing the command locally produces no errors. The workflow file was also run successfully using https://github.com/nektos/act, which pulls down the necessary images and claims to be configured to match Github's system.
To reproduce
We have not been able to reproduce outside of Github Actions.
.yarnrc.yml
open-pr.yml
Environment
Github Actions - Image: ubuntu-22.04 (latest) - Image Version: 20230217.1 - Node: 16.19.1 - Yarn: 3.3.1 The .yarn/** and .yarnrc.yml files are committed to our repo, so the yarn version is consistent across our CI and dev environments.
Additional context
We use this workflow to validate that our Github package updates are properly versioned before being published.
I've experienced the same issue using different runner images (ubuntu-20.04, ubuntu-18.04) and an older version of yarn (3.2.1)
Failure log example:
Some things I've tried:
yarn install
from scratchfetch-depth
, etc.The text was updated successfully, but these errors were encountered: