HTTPError('403 Client Error: Forbidden for url: https://gitlab.com/api/v4/projects/****/pipelines/****/variables')
(project and pipeline IDs redacted).
However, trying to query the Single Pipeline API in the same CI job does work as expected.
Also I should mention that the Project Access Token used in my CI job is obtained from a masked CI/CD variable whose value is the Project Access Token for a different project than the project the CI job belongs to.
My questions are:
- Am I using this Project Access Token as intended?
- Is that behavior (403 error for the Pipeline Variables API) expected or is this a bug to report?
- How can I then query the Pipeline Variables API for another project in my CI job, short of using a Personal Access Token.
Thank you for your help,
Edit — It simply turned out that the access token required maintainer privileges.