importcommand imports a OnePub authentication Token which you obtain by running the
exportcommand can either display the token to the console or save it to a file.
If run the import command with no arguments it expects to find an environment variable called
This technique is mostly used in a CI/CD environment which provides a secret store (e.g. github actions).
If you need to import into a shell that you have logged in to, then use the
onepub import --askoption.
The value of the
ONEPUB_TOKENenvironment variable is the authentication token reported by the onepub export command.
Run the onepub export command on your local machine after login into onepub
> onepub login
> onepub export
OnePub version: 1.4.1
Exporting OnePub token for OnePub.
Add the following environment variable to your CI/CD secrets.
Create the ONEPUB_TOKEN environment variable (this is usually done using your CI/CD secret store).
If you used the
exportcommand to display the token to the console then use the
import --askoption and type the token into the console:
onepub import --ask
If you exported the token in a file then you use the
onepub import --filecommand to import the token.
If you didn't specify a filename when exporting the OnePub Token then the token will have been saved into `./onepub.token.yaml`.
If you run the
import --filecommand without providing a file name then the
importcommand will assume the file
onepub.token.yamlcontains the token and lives in the current directory.
If you exported the OnePub Token to an alternatively named file or the token file is in a different directory then you can provide the path to the OnePub Token file.
onepub import --file <path to token file>