Skip to content

Commit f5e52fd

Browse files
milanholemansmartinlingstuyl
authored andcommitted
Fixes app id not found.
1 parent 6014072 commit f5e52fd

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ If self-hosted runners are used for running the workflow, then please make sure
9696

9797
## Release notes
9898

99+
### v2.0.2
100+
101+
- Fixes bug where app ID was invalid
102+
99103
### v2.0.0
100104

101105
- Renames action to 'CLI for Microsoft 365'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pnp/action-cli-deploy",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "GitHub Action to deploy an app using CLI for Microsoft 365",
55
"main": "dist/index.js",
66
"scripts": {

src/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ async function main() {
2424
core.error("🚨 Site collection URL - SITE_COLLECTION_URL - is needed when scope is set to sitecollection.");
2525
core.setFailed("SITE_COLLECTION_URL not specified");
2626
} else {
27-
appId = await executeCLIMicrosoft365Command(`spo app add -p ${appFilePath} --scope sitecollection --appCatalogUrl ${siteCollectionUrl} ${overwrite}`, true);
27+
const app = await executeCLIMicrosoft365Command(`spo app add -p ${appFilePath} --scope sitecollection --appCatalogUrl ${siteCollectionUrl} ${overwrite}`, true);
28+
appId = JSON.parse(app).UniqueId;
2829
await executeCLIMicrosoft365Command(`spo app deploy --id ${appId} --scope sitecollection --appCatalogUrl ${siteCollectionUrl} ${skipFeatureDeployment}`);
2930
}
3031
} else {
31-
appId = await executeCLIMicrosoft365Command(`spo app add -p ${appFilePath} ${overwrite}`, true);
32+
const app = await executeCLIMicrosoft365Command(`spo app add -p ${appFilePath} ${overwrite}`, true);
33+
appId = JSON.parse(app).UniqueId;
3234
await executeCLIMicrosoft365Command(`spo app deploy --id ${appId} ${skipFeatureDeployment}`);
3335
}
3436
core.info("✅ Upload and deployment complete.");

0 commit comments

Comments
 (0)