Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run inside a GitLab CI/CD pipeline? #161

Open
TheJanzap opened this issue Feb 26, 2025 · 0 comments
Open

Run inside a GitLab CI/CD pipeline? #161

TheJanzap opened this issue Feb 26, 2025 · 0 comments

Comments

@TheJanzap
Copy link

TheJanzap commented Feb 26, 2025

I've tried running gtt inside a GitLab pipeline to automate generating reports with following .gitlab-ci.yml:

stages:
  - build

build-report:
  stage: build
  image:
      name: kriskbx/gitlab-time-tracker
      entrypoint: [""]
  script:
    - gtt report --token=$CI_JOB_TOKEN --verbose

However, I recieve a 401 from GitLab's API:

Error: Project not found or no access rights "<ProjectName>".
{ StatusCodeError: 401 - {"message":"401 Unauthorized"}
....
uri: '[http://gitlab.example.com/api/v4/projects/projectname?private_token=[MASKED]&page=1&per_page=100'](http://gitlab.example.com/api/v4/projects/projectname?private_token=[MASKED]&page=1&per_page=100%27),

The project for which the time tracking report should be generated is in a different repo, but it has been added to the main repos CI/CD job token allowlist.
Are the permissions access the issues with the Job Token too weak?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant