Skip to content

chore(deps): bump dcarbone/install-jq-action from 3.2.0 to 4.0.1 in the dependencies group #82

chore(deps): bump dcarbone/install-jq-action from 3.2.0 to 4.0.1 in the dependencies group

chore(deps): bump dcarbone/install-jq-action from 3.2.0 to 4.0.1 in the dependencies group #82

Workflow file for this run

name: Deploy Action
permissions:
contents: read
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
test:
name: Deploy Authorization Model
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: jaxxstorm/action-install-gh-release@25e24d2d23ae098373794ef1d6faecb48ee52da8
with:
repo: openfga/openfga
cache: enable
- name: Run a local OpenFGA Server
shell: bash
## The key used here is a mock for demo purposes only
run: |
openfga --authn-method preshared --authn-preshared-keys key1 run&
- name: Create a store
shell: bash
run: |
curl -X POST http://localhost:8080/stores -H "content-type: application/json" -H "Authorization: Bearer key1" -d '{"name": "FGA Demo Store"}' > id.json
- name: Get store ID
id: get-store-id
shell: bash
run: |
echo "store_id=$(jq -r '.id' id.json)" >> "$GITHUB_OUTPUT"
- name: Deploy using a file
id: deploy-file
uses: ./
with:
api-url: http://localhost:8080
api-token: key1
store-id: ${{ steps.get-store-id.outputs.store_id }}
model-file-path: ./example/model.fga
- name: Output the model ID
run: |
echo "The model ID is ${{ steps.deploy-file.outputs.authorization_model_id }}"
- name: Deploy using a string
id: deploy-string
uses: ./
with:
api-url: http://localhost:8080
api-token: key1
store-id: ${{ steps.get-store-id.outputs.store_id }}
format: json
model: '{\"schema_version\":\"1.1\",\"type_definitions\":\[\{\"type\":\"user\"\},\{\"type\":\"document\",\"relations\":\{\"reader\":\{\"this\":\{\}\},\"writer\":\{\"this\":\{\}\},\"owner\":\{\"this\":\{\}\}\},\"metadata\":\{\"relations\":\{\"reader\":\{\"directly_related_user_types\":\[\{\"type\":\"user\"\}\]\},\"writer\":\{\"directly_related_user_types\":\[\{\"type\":\"user\"\}\]\},\"owner\":\{\"directly_related_user_types\":\[\{\"type\":\"user\"\}\]\}\}\}\}\]\}'
- name: Output the model ID
run: |
echo "The model ID is ${{ steps.deploy-string.outputs.authorization_model_id }}"