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

How to setup standard-version in Azure pipeline? #598

Open
hmendezm opened this issue Jun 2, 2020 · 6 comments
Open

How to setup standard-version in Azure pipeline? #598

hmendezm opened this issue Jun 2, 2020 · 6 comments

Comments

@hmendezm
Copy link

hmendezm commented Jun 2, 2020

Hi guys,

I have a pipeline and I want to add standard-version. I did add npm tasks and run release-note ( "release-notes": "standard-version") but it failed. it looks like it is an authentication error. What Do I do wrong? How can I use the process authentication so I avoid using specific user?

standard-version
2020-06-02T15:07:21.8634345Z warning: LF will be replaced by CRLF in CHANGELOG.md.
2020-06-02T15:07:21.8634495Z
2020-06-02T15:07:21.8634790Z The file will have its original line endings in your working directory
2020-06-02T15:07:21.8640558Z √ bumping version in package.json from 1.0.101 to 1.0.102
2020-06-02T15:07:21.8640905Z warning: LF will be replaced by CRLF in CHANGELOG.md.
2020-06-02T15:07:21.8641210Z The file will have its original line endings in your working directory
2020-06-02T15:07:21.8641654Z
2020-06-02T15:07:21.8641943Z *** Please tell me who you are.
2020-06-02T15:07:21.8642073Z
2020-06-02T15:07:21.8642189Z Run
2020-06-02T15:07:21.8642277Z
2020-06-02T15:07:21.8642448Z git config --global user.email "you@example.com"
2020-06-02T15:07:21.8642680Z git config --global user.name "Your Name"
2020-06-02T15:07:21.8643036Z
2020-06-02T15:07:21.8643191Z to set your account's default identity.
2020-06-02T15:07:21.8643416Z Omit --global to set the identity only in this repository.
2020-06-02T15:07:21.8643565Z
2020-06-02T15:07:21.8643764Z fatal: unable to auto-detect email address (got 'VssAdministrator@fv-az314.(none)')
2020-06-02T15:07:21.8643964Z
2020-06-02T15:07:21.8644222Z Command failed: git commit CHANGELOG.md package.json package-lock.json -m "chore(release): 1.0.102"
2020-06-02T15:07:21.8644548Z warning: LF will be replaced by CRLF in CHANGELOG.md.
2020-06-02T15:07:21.8644814Z The file will have its original line endings in your working directory
2020-06-02T15:07:21.8645865Z warning: LF will be replaced by CRLF in CHANGELOG.md.
2020-06-02T15:07:21.8646117Z The file will have its original line endings in your working directory
2020-06-02T15:07:21.8646281Z
2020-06-02T15:07:21.8646429Z *** Please tell me who you are.
2020-06-02T15:07:21.8646542Z
2020-06-02T15:07:21.8646635Z Run
2020-06-02T15:07:21.8646713Z
2020-06-02T15:07:21.8646866Z git config --global user.email "you@example.com"
2020-06-02T15:07:21.8647104Z git config --global user.name "Your Name"
2020-06-02T15:07:21.8647234Z
2020-06-02T15:07:21.8647374Z to set your account's default identity.
2020-06-02T15:07:21.8647603Z Omit --global to set the identity only in this repository.
2020-06-02T15:07:21.8647751Z
2020-06-02T15:07:21.8647952Z fatal: unable to auto-detect email address (got 'VssAdministrator@fv-az314.(none)')

@tnc1997
Copy link

tnc1997 commented Jun 27, 2020

It looks like you need to configure the user email and user name for git before running the standard-version command. The user email and user name could be configured in a separate step before running the standard-version command.

steps:
  - checkout: self
    persistCredentials: true
  - script: |
      git config --global user.email 'you@example.com'
      git config --global user.name 'Your Name'
  - task: NodeTool@0
    inputs:
      versionSpec: '14.x'
  - script: |
      npx standard-version
      git push --follow-tags origin master

@hmendezm
Copy link
Author

Thanks, tnc1997. In the end, I decided to use sematic-release.

@Yanal-Yves
Copy link

I found this article that might be helpfull:
https://medium.com/@jazz.twk/automate-versioning-in-cicd-with-azure-devops-a65a9a6f4e69

@hmendezm
Copy link
Author

Thanks for the info

@danielmhair
Copy link

I had this same issue. I wasn't subscribed to medium, so I couldn't see the solution. However, after making a free trial, I read it. For those who may be in my boat and don't want to subscribe to medium, I needed to do 3 things to get it to work:

  1. Navigate to Repository Permission under Project Settings > Repos > Repositories > Permission Tab.
  2. Under the Permission page, select your Build Service Account under the Users section. Your build service name should be something with {Project Name} Build Service. On the right-hand side of the permission setting, allow the permissions "Contribute", "Create tag", and "Bypass policies when pushing"
  3. Read my solution in this issue: Best way to authenticate against a git repository in a build process microsoft/azure-pipelines-agent#1601 (comment)

@hmendezm
Copy link
Author

Thank you Daniel for sharing your solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants