Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
This repository was archived by the owner on May 22, 2025. It is now read-only.

Run inside a GitLab CI/CD pipeline? #161

@TheJanzap

Description

@TheJanzap

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions