screwdriver-api 8.0.36 → 8.0.37

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.36",
3
+ "version": "8.0.37",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -778,11 +778,17 @@ async function createPrClosedEvent(options, request) {
778
778
  try {
779
779
  const b = await p.branch;
780
780
  let eventConfig = {};
781
-
782
- let configPipelineSha = '';
781
+ const token = await p.token;
782
+ const pScmConfig = {
783
+ scmUri: p.scmUri,
784
+ token,
785
+ scmRepo: p.scmRepo,
786
+ scmContext: scmConfig.scmContext
787
+ };
788
+ let latestPipelineSha = '';
783
789
 
784
790
  try {
785
- configPipelineSha = await pipelineFactory.scm.getCommitSha(scmConfig);
791
+ latestPipelineSha = await pipelineFactory.scm.getCommitSha(pScmConfig);
786
792
  } catch (err) {
787
793
  if (err.status >= 500) {
788
794
  throw err;
@@ -808,14 +814,14 @@ async function createPrClosedEvent(options, request) {
808
814
  webhooks: true,
809
815
  username,
810
816
  scmContext: scmConfig.scmContext,
811
- sha,
817
+ sha: latestPipelineSha || sha,
812
818
  startFrom: isPipelineBranch ? startFrom : `${startFrom}:${branch}`,
813
819
  changedFiles,
814
820
  causeMessage: isPipelineBranch ? causeMessage : `${causeMessage} on branch ${branch}`,
815
821
  ref,
816
822
  baseBranch: branch,
817
823
  meta: createMeta(options),
818
- configPipelineSha,
824
+ configPipelineSha: latestPipelineSha,
819
825
  prNum,
820
826
  chainPR: resolvedChainPR
821
827
  };