Comments (13)
Hang on. You've pinned the pre-fixed version of the Github Action. You have this in your log, @jamesmcguirepro:
Run dotnet/[email protected]
Please either use @master
or @v0.4.0
.
from nbgv.
Thanks for sharing that doc though. I'll reach out to the github folks to ask why they're recommending that.
from nbgv.
@wjrogers FYI I filed some feedback and sent this PR to fix the docs. It'll be interesting to see how they respond to it.
I did a quick test, and current versions of git still do not download tags they already know about, so indeed redefining a tag is a recipe for great confusion amongst many git clone users.
from nbgv.
@j2ghz I'm glad v0.4 is working for you. I can't publish new versions to the marketplace now, but thank you for pointing out that I missed it. I've reached out to the .NET Foundation folks to accept a github agreement so that I can publish new versions there again.
from nbgv.
Duplicate of #32
Please attach links to your GitHub workflow executions so we can investigate the logs and find out why the existing fix for this isn't resolving it for your case.
from nbgv.
Unfortunately, it's a private repo. I did attach the output of the command. Here's how we are calling it:
# Use Nerdbank.GitVersioning to set version variables: https://github.com/dotnet/nbgv
- name: Use Nerdbank.GitVersioning to set version variables
uses: dotnet/[email protected]
with:
setAllVars: true
I think #32 and dotnet/Nerdbank.GitVersioning#516 fixed the calls to the set-env
command.
However, add-path
is a separate command.
I don't know typescript very well, but if I had to guess, this could be a cause: https://github.com/dotnet/nbgv/blob/master/src/main.ts#L21
from nbgv.
Thanks, @jamesmcguirepro. I'm glad to hear set-env is fixed. Regarding add-path, that code you found is calling through the github actions NPM package which is updated and I confirmed will avoid the console logging command. Are you saying the problem still repros even after this issue was closed a few hours ago?
from nbgv.
Just repro'd it a few minutes ago. I have also been using ACTIONS_ALLOW_UNSECURE_COMMANDS: true
as a workaround for now.
Run dotnet/[email protected]
"C:\Program Files\dotnet\dotnet.exe" tool install -g nbgv
Welcome to .NET Core 3.1!
---------------------
SDK Version: 3.1.403
Telemetry
---------
The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
----------------
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Find out what's new: https://aka.ms/dotnet-whats-new
Learn about the installed HTTPS developer cert: https://aka.ms/aspnet-core-https
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs
Write your first app: https://aka.ms/first-net-core-app
--------------------------------------------------------------------------------------
You can invoke the tool using the following command: nbgv
Tool 'nbgv' (version '3.3.37') was successfully installed.
Error: Unable to process command '::add-path::C:\Users\runneradmin\.dotnet\tools' successfully.
Error: The `add-path` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
C:\Users\runneradmin\.dotnet\tools\nbgv.exe get-version -f json -p .
from nbgv.
FWIW, the GitHub Actions documentation strongly encourages pinning actions to a release tag. I also did not realize this action had been fixed because I was using the latest release (which is still v0.3.1 the moment). Do you have any plans to adopt the "floating major version tag" convention?
from nbgv.
Great. I'm glad you're unblocked.
I don't think "floating major version tag" is a thing. Git does not do well with tags that ever get redefined. Rather, I suspect you're referring to servicing branches. And yes, I usually do that but haven't started that till now.
I've pushed v0.4
as a branch so you can use dotnet/[email protected]
if you want to 'float up' with any servicing fixes made to the 0.4 release. Pinning to the v0.4.0
tag is still possible, but no servicing can happen on a tag.
from nbgv.
@AArnott https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/about-actions#using-tags-for-release-management
Move the major version tag (such as v1, v2) to point to the Git ref of the current release.
GitHub's official docs recommend moving major version tags with each release. I'm not sure what I think about it, personally, but it's what all the official actions are doing. As a user, it does make it easier to track bug fixes. 🤷♂️
from nbgv.
I don't know how they get away with that, since git clones do not fetch tags they already have, so moving tags is a very broken idea (at least last I checked). Anyway, from a GitHub Action consumer's perspective, tag vs. branch is equivalent, so I'll be using the git concept that reflects things that move (branches) rather than tags.
from nbgv.
I think this issue should be kept open until solved. Today I clicked on "Use latest version" on https://github.com/marketplace/actions/nerdbank-gitversioning and got a version that doesn't work.
Furthermore, 0.4.0 is not listed there, but when specified manually it works:
from nbgv.
Related Issues (20)
- nbgv stopped working on GitHub CI in last few days after upgrade to [email protected] HOT 1
- [email protected] System.NullReferenceException: Object reference not set to an instance of an object. HOT 1
- Add option to tag a public version based on calculated nbgv version HOT 3
- Question regarding PublicRelease HOT 2
- Add usage documentation? HOT 5
- Preview Builds in PR for NuGet? HOT 2
- Regarding nbgv.json HOT 3
- Warning while running NBGV task HOT 4
- Publish 0.4.0 on GitHub Marketplace HOT 2
- Action fails if nbgv is already installed
- Take parameters for `nbgv cloud` command
- Wrong `BuildingRef` when a prior GitHub action moves HEAD HOT 13
- Update nbgv action to run on node 16 HOT 3
- Do not use set-output HOT 4
- Add option to stamp package.json with nbgv version HOT 2
- Are actions not running on this repo itself? HOT 3
- Allow specifying path to version.json file HOT 1
- nbgv error when running in github action HOT 2
- Error when installing dotnet before nbgv HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nbgv.