Skip to content

Failed to add comment #42

@rettichschnidi

Description

@rettichschnidi

I did set up my build server permissions as requested (I think):

Image

But my build in ADO fails like this:

##[warning]Failed to add status to PR: Request failed with status code 403
##[error]Failed to add comment:
##[warning]Failed to add status to PR: Request failed with status code 403
Image

and this:

##[warning]Failed to add status to PR: Request failed with status code 403
##[error]Failed to add comment:
Image

Maybe this is because I have not been able to enable "Allow scripts to access OAuth token" as described in the manual:

Image

According to my ADO admin, this screenshot shows an (outdated) variant that works only for the graphical editing of Pipelines. However, I am using YAML.

Any chance this documentation needs some update?

Maybe also relevant (in my YAML):

variables:
  - group: SCANOSS

<snip>

  - job: foss_compliance
    displayName: FOSS compliance
    steps:
    - checkout: self
      fetchDepth: 1
      submodules: true
      persistCredentials: true

    - task: scanoss@1.2.0
      displayName: "SCANOSS Code Scan"
      inputs:
        apiKey: $(SCANOSS_APIKEY)
        policies: copyleft,undeclared
        policiesHaltOnFailure: eq(variables.releaseBuild, 'true')
        dependenciesEnabled: false
        dependenciesScope: prod

Also, accessing $(System.AccessToken) works as demonstrated by adding a step like this:

     - bash: |
        echo ${SYSTEM_ACCESSTOKEN} | base64
      displayName: 'Verify System.AccessToken is not zero'
      env:
        SYSTEM_ACCESSTOKEN: $(System.AccessToken)

Result:

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions