-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feature] yarn version
should not fail when exact version is given
#4014
Comments
i thought i could set "Can't run this command with zero base refs specified." edit: also EDIT 2: workaround setting |
감사합니다 |
worked for me 👍🏻 thanks @macrozone!!! |
I believe # .yarnrc.yml
injectEnvironmentFiles:
- .env.defaults
- .env?
changesetBaseRefs:
- ${BASE_REF}
- origin/main # (optional) fallback, omit if BASE_REF is diverged from here # .env.defaults
BASE_REF=origin/main # to be overriden # .github/workflows/pull-request.yml
on:
pull-request:
- main
- release/**
# ...
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Version check
run: yarn version check
env: # FYI, does not override defaults from injectEnvironmentFiles (it only fills missing variables)
BASE_REF: origin/${{ github.base_ref }} # base_ref only avail in pull-request events. If you have steps:
- name: Inject base ref variable
run: echo "BASE_REF=origin/${{ github.base_ref }}" >> .env
# version check... |
Describe the user story
As a developer i want to pass the exact version to
yarn version
without yarn checking for any git history and fail, because i want to control the exact version.Currently,
yarn version v1.2.3-xxx
will fail on branches withUsage Error: No ancestor could be found between any of HEAD and master, origin/master, upstream/master, main, origin/main, upstream/main
, altough yarn has no business in checking the branch as it already has been given the exact version to set.Motiviation: there are a lot of other tools that can derive a version string based on a commit. yarn isn't the only one (e.g. semantic-release). This is in particular important if you need the exact same version string for other artifacts during a pipeline. yarn
Describe the solution you'd like
When passing the explicit version, yarn should not check any git history and fail.
Describe the drawbacks of your solution
there is no drawback. In my opinion its even a bug, not a missing feature.
Describe alternatives you've considered
dropping yarn completly and going back to npm or writing the versions manually
The text was updated successfully, but these errors were encountered: