Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Packages in pipelines

Sascha Andres
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 17, 2026

I have a step that looks like this:

 

 - step:
image:
name: crg.apkg.io/ws/img:latest
username: $BITBUCKET_PACKAGES_USERNAME
password: $BITBUCKET_PACKAGES_TOKEN
I understand the documentation that the variables are set automatically. nevertheless, I get an unauthorized error when running the step
Anyone had success with that?
Best regards,
Sascha

2 answers

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2026

Hey @Sascha Andres 

Welcome to the community.

If the image crg.apkg.io/ws/img:latest belongs to a different repository (even within the same workspace), the native token will not have permission to pull it. Can you confirm that the hosted image in the same repository that is running the pipeline?

Regards,
Syahrul

Sascha Andres
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 22, 2026

Hi,

the whole point is to habe a build image that is re-used in different other repositories in my case.

So yes, it is a different repository, but in the same workspace.

Best regards,

Sascha

Like James Zhang likes this
James Zhang
April 22, 2026

Exactly.

Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 23, 2026

Hey @Sascha Andres 

Thanks for the update and for sharing your goal.

To help me investigate further, could you please provide the exact error message you received (e.g., 404 Not Found, 401 Unauthorized)?

In the meantime, please try the following steps to ensure your authentication is configured correctly:

  1. Update your Pipeline variables: Instead of using default variables, please define custom secured variables in your repository settings. For example:

    • $PACKAGE_USERNAME

    • $PACKAGE_TOKEN

  2. Configure $PACKAGE_USERNAME: Set this variable to your Atlassian account email address (e.g., abc@company.com).

  3. Generate $PACKAGE_TOKEN: Create an API token with scopes by following our official guide. Ensure you select the read:package:bitbucket scope (and write:package:bitbucket if you are publishing).

  4. Update your bitbucket-pipelines.yml: Ensure your configuration references these variables correctly, similar to the example below:

image:
name: crg.apkg.io/<workspace>/<packagename>:latest
username: $PACKAGE_USERNAME
password: $PACKAGE_TOKEN

pipelines:
default:
- step:
name: Build and Test
script:
- echo "Running in custom base image from RepoA"

Let me know how it goes

Regards,
Syahrul

0 votes
James Zhang
April 19, 2026

No. That doesn't work.
It seems those native credentials only works when you push image inside the image build repo.
I'm also seeking the right way like yours on how to consume the image using native auth inside pipeline.
If anyone have succeeded please share. Thanks in advance.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events