My first #GitHubAction is ready for public use:
https://github.com/marketplace/actions/pnp-powershell-sharing-settings-as-code
It can be used to enforce the sharing settings of #SharePoint Online sites as code.
If you use this action to enforce the settings as code you can minimize the risks of human error during day to day SharePoint Admin operations.
uses: actions/pnp-sharing-settings-action@v1
with:
SHAREPOINT_ADMIN_URL: 'https://contoso-admin.sharepoint.com'
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
SHARINGCAPABILITY_DISABLED_SITES: 'ALLELSE'
SHARINGCAPABILITY_EXTERNALUSERSHARINGONLY_SITES: 'https://contoso.sharepoint.com/, https://contoso.sharepoint.com/sites/Development'
SHARINGCAPABILITY_EXTERNAUSERANDGUESTSHARING_SITES: 'https://contoso.sharepoint.com/sites/HR, https://contoso.sharepoint.com/sites/bteam, https://contoso.sharepoint.com/sites/ateam'
SHARINGCAPABILITY_EXISTINGEXTERNALUSERSHARINGONLY_SITES: 'null'