This action reads the permissions.json
file in your repository and registers the permissions and groups contained within that file with PPS.
Required The file that contains your application permissions - this file should be in the top level of your repository.
{
"permissions": [
{
"name": "View Permission",
"description": "Permission that grants user access to view nodes",
"applicationInternalCode": "ViewPermission"
},
{
"name": "Create Permission",
"description": "Permission that grants user access to create nodes",
"applicationInternalCode": "CreatePermission"
}
],
"groups": [
{
"name": "Basic Access Group",
"description": "This group provides the permissions required for basic access to our application",
"applicationInternalCode": "BasicAccessGroup",
"permissionInternalCodes": [
"ViewPermission",
"CreatePermission"
]
}
]
}
example permissions.json
These environment variables must be set in your repository secrets under the actions section: Settings > Secrets > Actions > New Repository Secret
Required The client ID of your application.
Required The client secret for your application.
Required The environment
variable determines which PPS environment you wish to register your permissions with.
Accepted Values: development
, staging
, production
name: 'Register Application Permissions'
on:
push:
branches:
- main # Replace with your main branch name
jobs:
build:
runs-on: ubuntu-latest
steps:
- id: s1
uses: actions/checkout@v2
- id: s2
uses: sainsburys-tech/pps-register-permissions@v0.0.9
with:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{secrets.CLIENT_SECRET}}
ENVIRONMENT: "development"