Skip to content

Unable to publish package #25395

Answered by BrightRan
badgerowluke asked this question in Actions
Discussion options

You must be logged in to vote

@badgerowluke,
I noticed the below step in your workflow,

- run: sed 's/TOKEN/${{secrets.GITHUB_TOKEN}}/'  ./nuget.config

looks like, you directly replace the TOKEN with the GITHUB_TOKEN secret in the nuget.config file.

In most cases, directly using the GITHUB_TOKEN secret in the config or setting files is not allowed. You need to set the GITHUB_TOKEN secret as an environment variable, then pass the environment variable into the config/setting files. Other secrets set in the GitHub repository are similar.
So, in your case, you can try like as below:

- name: Pass token
  run: sed 's/TOKEN/%GITHUB_TOKEN%/'  ./nuget.config
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The following …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Packages Host your dependencies, libraries, and production-ready code, right from your repository Product Feedback
2 participants