Post

Replies

Boosts

Views

Activity

Reply to Xcode Cloud API - documentation
I think you need to look thru all the scmGitReferences to find the branch one from previous run for your branch. It looks like    "canonicalName": "refs/heads/stage" for my branch stage. {  "data": {   "type": "scmGitReferences",   "id": "6ce1ce69-c00b-46d1-8453-887f23b8JJHS",   "attributes": {    "name": "stage",    "canonicalName": "refs/heads/stage",    "isDeleted": false,    "kind": "BRANCH"   },   "links": {    "self": "https://api.appstoreconnect.apple.com/v1/scmGitReferences/6ce1ce69-c00b-46d1-8453-887f23b8JJHS"   }  },  "included": {} } This works for me {       "sourceBranchOrTag": {         "data": {          "type": "scmGitReferences",          "id": "6ce1ce69-c00b-46d1-8453-887f23b8JJHS"         }       },       workflow: {         data: {           type: "ciWorkflows",           id: `${branch === 'stage' ? stageWorkflow : prodWorkflow}`         }       }     }; How did I get the IDs? Start with your workflow:   const gitRef = await readAll('https://api.appstoreconnect.apple.com/v1/ciWorkflows/59D98329-2C36-4A9D-A657-B32EJUNK/relationships/repository');  console.log(JSON.stringify(gitRef, null, 2)); Then look at gitReferences:  const gitrepo = await readAll('https://api.appstoreconnect.apple.com/v1/scmRepositories/02604932-197a-48a0-b182-fa78f97JUNK/relationships/gitReferences');  console.log(JSON.stringify(gitrepo, null, 2)); then find the right one -- to see in detail:  const reference = await readAll('https://api.appstoreconnect.apple.com/v1/scmGitReferences/6ce1ce69-c00b-46d1-8453-887f23b8JJHS');  console.log(JSON.stringify(reference, null, 2));
Jan ’23
Reply to Xcode cloud and multiple bundle ids?
You can do this with the API. First, change your bundle in Xcode, and click the Cloud to authenticate. Create the workflow on the bundle id. Then you can switch your Xcode back to old bundle. Then just use the App Store Connect web site to manage it. Then to kick it off your pipeline (bitbucket or Azure Pipeline) can trigger the start on a branch using the appstoreconnectapi - start build number.
Jan ’23