0.0.16 • Published 1 year ago

pps-register-permissions-gh-action v0.0.16

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

PPS Register Permissions GitHub action

This action reads the permissions.json file in your repository and registers the permissions and groups contained within that file with PPS.

Inputs

Files

permissions.json

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

Environment Variables

These environment variables must be set in your repository secrets under the actions section: Settings > Secrets > Actions > New Repository Secret

CLIENT_ID

Required The client ID of your application.

CLIENT_SECRET

Required The client secret for your application.

ENVIRONMENT

Required The environment variable determines which PPS environment you wish to register your permissions with.

Accepted Values: development, staging, production

Example usage

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"