注册跑步者...禁止 - gitlab-runner.exe 注册

Registering runner... forbidden - gitlab-runner.exe register

我正在尝试使用 GitLab CI/CD 功能,但是当我尝试注册 运行ner 时,我 运行 遇到了问题。我的意图是,每当我将新文件推送到我的 angular 项目存储库时,我的 e2e 测试将被触发,并将 运行 在 运行ner.

基本上,我正在按照此处的分步指南进行操作 https://medium.com/letsboot/angular-continuous-delivery-deployment-with-gitlab-ci-stage-on-commit-and-prod-on-git-tag-151ce3c74619

这些是我采取的步骤:

在这一点上,当我查看项目 gitlab 管道时,我已经期望看到我的测试被触发。但实际上我在 deme>angular_ci_cd>Pipelines 下看到了一个欢迎页面 "Build with confidence"。老实说,我并没有期待进一步的配置,但我遵循了指导 https://docs.gitlab.com/runner/register/ (Windows)

希望我从正确的地方得到了令牌:https://gitlab.com/profile/personal_access_tokens > 你的新个人访问令牌

以防万一,这是我的 git 配置(我使用的是 HTTPS 而不是 SSH)。我的意思是,我没有添加 SSH 密钥,我认为我不需要它:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
[remote "origin"]
    url = https://gitlab.com/carv/angular_ci_cd.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master

*** 已编辑

C:\GitLab-Runner>gitlab-runner.exe register
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
https://gitlab.com
Please enter the gitlab-ci token for this runner:
xxxxx
Please enter the gitlab-ci description for this runner:
[win10-cha]: my second tentative
Please enter the gitlab-ci tags for this runner (comma separated):
my-tag, another-tag
Whether to run untagged builds [true/false]:
[false]: true
Whether to lock the Runner to current project [true/false]:
[true]: true
Registering runner... succeeded                   [0;m  runner[0;m=xtr3ae4U
Please enter the executor: shell, ssh, docker-ssh+machine, kubernetes, docker, docker-ssh, parallels, virtualbox, docker+machine:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded![0;m

C:\GitLab-Runner>

您使用了错误的令牌。您需要从此页面获取跑步者注册令牌:https://gitlab.com/carv/angular_ci_cd/settings/ci_cd

以下是页面查找我创建的测试项目的方式:

您必须使用自己的令牌,而不是上图中的令牌。