0

I am trying to deploy to siteCollection appcatalog on each push to my github repository using github actions. Saw that it's possible using Office 365 CLI action, but that only allows tenant admins to deploy.

Before I run the powershell script I build and create the .sppkg file. So I used PowerShell's SharePointPnPPowerShellOnline Module in github actions. I was able to connect to the site.

I'm not able to find a way to access the .sppkg file and deploy it to the site

Below is my code

Install-Module -Name SharePointPnPPowerShellOnline -Force -Verbose -Scope CurrentUser

$siteUrl = "https://test.sharepoint.com"
$username = "xyz@abc.com" 
$password = "myPassword"      

$encpassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $encpassword

Connect-PnPOnline -Url $siteUrl -Credentials $cred

Write-Host "logged in"

#code to access the sppkg file and deploy it to the site collection appcatalog

--------------------------------------------------------------------------------
$getTheSPPKGFile = *************

Add-PnPApp -Path $theSPPKGFile -Publish -Overwrite
--------------------------------------------------------------------------------

Any search is resulting to tenant admin approach. I don't have tenant admin access, only site collection admin access.

Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.