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
Folder structure
Below is my code
Install-Module -Name SharePointPnPPowerShellOnline -Force -Verbose -Scope CurrentUser
$siteUrl = "https://test.sharepoint.com"
$username = "[email protected]"
$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
