screwdriver-api 8.0.48 → 8.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-api",
3
- "version": "8.0.48",
3
+ "version": "8.0.50",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -374,7 +374,14 @@ async function updateBuildAndTriggerDownstreamJobs(config, build, server, userna
374
374
  const stageIsDone = isStageDone(stageJobBuilds);
375
375
 
376
376
  if (stageIsDone) {
377
- const teardownNode = newEvent.workflowGraph.nodes.find(n => n.id === stageTeardownJob.id);
377
+ // Determine the actual job name in the graph by stripping PR prefix (e.g., "PR-123:")
378
+ // if this is a PR build, since workflowGraph nodes do not include PR-specific prefixes.
379
+ const prMatch = stage.name.match(PR_STAGE_NAME);
380
+ const teardownOriginalJobName = prMatch
381
+ ? stageTeardownName.replace(`${prMatch[1]}:`, '')
382
+ : stageTeardownName;
383
+
384
+ const teardownNode = newEvent.workflowGraph.nodes.find(n => n.name === teardownOriginalJobName);
378
385
 
379
386
  // Update teardown build
380
387
  stageTeardownBuild = await createOrUpdateStageTeardownBuild(