fix stop-recent-builds for forks

This commit is contained in:
Willy Kloucek
2021-08-06 13:47:52 +02:00
parent 737cca6600
commit 8b65d74a44

View File

@@ -214,8 +214,6 @@ def checkForRecentBuilds(ctx):
return pipelines
def stopRecentBuilds(ctx):
repo_slug = ctx.build.source_repo if ctx.build.source_repo else ctx.repo.slug
return [{
"name": "stop-recent-builds",
"image": "drone/cli:alpine",
@@ -227,8 +225,8 @@ def stopRecentBuilds(ctx):
},
},
"commands": [
"drone build ls %s --status running > /drone/src/recentBuilds.txt" % repo_slug,
"drone build info %s ${DRONE_BUILD_NUMBER} > /drone/src/thisBuildInfo.txt" % repo_slug,
"drone build ls %s --status running > /drone/src/recentBuilds.txt" % ctx.repo.slug,
"drone build info %s ${DRONE_BUILD_NUMBER} > /drone/src/thisBuildInfo.txt" % ctx.repo.slug,
"cd /drone/src && ./tests/acceptance/cancelBuilds.sh",
],
"when": {