Hello!
I have configured a step in our bitbucket pipeline for clearing the cache for node in case there are any changes in package.json.
The issue is that the script is throwing an error regarding app username & pass, although I've set the Access token in the env variables in bitbucket and used the access token in the pipeline step.
Pipeline step:
- step:
name: 'Clear cache if dependency changed'
script:
- pipe: atlassian/bitbucket-clear-cache:3.1.1
variables:
BITBUCKET_ACCESS_TOKEN: $BITBUCKET_ACCESS_TOKEN
CACHES: ["bff-node"]
DEBUG: "true"
condition:
changesets:
includePaths:
# only if bff package.json file has changed
- "apps/api/package.json"
Error:
✖ Validation errors:
BITBUCKET_APP_PASSWORD: - required field
BITBUCKET_USERNAME: - required field
Hey @Simona Grigoras ,
and welcome to the Community!
The support for access tokens in the atlassian/bitbucket-clear-cache was released in a more recent version of the pipe.
We can verify which exact version by checking that pipe's CHANGELOG file where it can be confirmed that token-based authentication was introduced in version 3.3.0 :
3.3.0
- minor: Add support for token based authentication.
- patch: Internal maintenance: update docker image and packages.
Since you're currently using version 3.1.1, the pipe does not recognize the access token variable and throws an error.
In this case, for the usage of access token to work, you'll need to update your YAML to use a more recent version of the pipe >= 3.3.0.
I'd strongly recommend using the latest version as it includes bugfixes and enhancements. By the time I write this message, the latest version is 3.6.2:
script: - pipe: atlassian/bitbucket-clear-cache:3.6.2 variables: BITBUCKET_ACCESS_TOKEN: $BITBUCKET_ACCESS_TOKEN
<rest of variables>
I hope that information helps! Let us know in case you have any questions.
Thank you, @Simona Grigoras !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.