coenm / RepoM

👨‍💻 A minimal-conf git repository hub for Windows . This project is a fork of RepoZ
MIT License
9 stars 2 forks source link

Pull request in AzureDevops is not working when source is external #116

Closed coenm closed 4 weeks ago

coenm commented 5 months ago

see https://dev.azure.com/cmunckhof/Open%20Source/_build/results?buildId=1987&view=results

coenm commented 5 months ago

image

coenm commented 5 months ago

References service endpoint. PRs from repository forks are not allowed to access secrets in the pipeline. For more information see https://go.microsoft.com/fwlink/?linkid=862029

coenm commented 5 months ago

Run analysis error message

Starting: Run Code Analysis

Task : Run Code Analysis Description : Run scanner and upload the results to the SonarCloud server. Version : 1.45.0 Author : sonarsource Help : Version: 1.45.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

More Information

[error]Variables are missing. Please make sure that you are running the Prepare task before running the Analyze task.

Make sure you are not mixing tasks from different major versions. If you are using a multistage pipeline, make sure the tasks are in the same stage. Finishing: Run Code Analysis

coenm commented 4 months ago

https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml

SYSTEM_PULLREQUEST_ISFORK = False condition: ne(variables['Build.SourceBranch'], 'refs/heads/external-repo/*')

coenm commented 4 months ago

SYSTEM_PULLREQUEST_ISFORK = False
SYSTEM_PULLREQUEST_MERGEDAT =
SYSTEM_PULLREQUEST_PULLREQUESTID = 1899017550
SYSTEM_PULLREQUEST_PULLREQUESTNUMBER = 129
SYSTEM_PULLREQUEST_SOURCEBRANCH = feature/docs-tags
SYSTEM_PULLREQUEST_SOURCECOMMITID = 82a077e6b7a6350e837af8ca387d9924de7460e1 SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI = https://github.com/coenm/RepoM SYSTEM_PULLREQUEST_TARGETBRANCH = main
SYSTEM_PULLREQUEST_TARGETBRANCHNAME = main

BUILD_REASON = PullRequest
BUILD_SOURCEBRANCH = refs/pull/129/merge

BUILD_REPOSITORY_ID = coenm/RepoM
BUILD_REPOSITORY_NAME = coenm/RepoM
BUILD_REPOSITORY_URI = https://github.com/coenm/RepoM

coenm commented 4 weeks ago
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/cmunckhof/'), ne(variables['Build.Reason'], 'PullRequest'))