https://github.com/openfga/action-openfga-deploy
Github Action for deploying your Authorization Model to an OpenFGA Store
https://github.com/openfga/action-openfga-deploy
Last synced: 6 months ago
JSON representation
Github Action for deploying your Authorization Model to an OpenFGA Store
- Host: GitHub
- URL: https://github.com/openfga/action-openfga-deploy
- Owner: openfga
- License: apache-2.0
- Created: 2024-01-09T15:31:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-09-18T23:05:57.000Z (7 months ago)
- Last Synced: 2025-09-19T00:44:24.993Z (7 months ago)
- Size: 89.8 KB
- Stars: 7
- Watchers: 13
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY-INSIGHTS.yml
Awesome Lists containing this project
- awesome - openfga/action-openfga-deploy - Github Action for deploying your Authorization Model to an OpenFGA Store (<a name="Not%20Set"></a>Not Set)
README
# OpenFGA Github Action - Deploy
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fopenfga%2Faction-openfga-deploy?ref=badge_shield)
This action can be used to deploy your authorization model to an OpenFGA store.
## Parameter
| Parameter | Required/Optional | Description |
|-------------------|-------------------|--------------------------------------------------------------------------------------------------------------|
| `api-url` | Required | The URL to your OpenFGA server |
| `api-token` | Required | The token used to when preshared keys are used to authenticate the OpenFGA server |
| `store-id` | Required | The store to which the model should be deployed |
| `model-file-path` | Optional | The path to your model file relative to the root of your project |
| `model` | Optional | The model value if file is not used, Ensure it is character escaped. |
| `format` | Optional | Authorization model input format. Can be "fga" or "json", defaults to auto-detecting from the file extension |
## Outputs
| Output | Description |
|--------------------------|--------------------------------------------|
| `authorization_model_id` | The ID of the deployed Authorization Model |
## Example
```yaml
name: Deploy Action
on:
workflow_dispatch:
jobs:
deploy:
name: Deploy Authorization Model
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy using a file
uses: openfga/action-openfga-deploy@v0.1.0
with:
api-url: http://localhost:8080
api-token: ${{ secrets.KEY }}
store-id: ${{ env.STORE_ID }}
model-file-path: ./example/model.fga
- name: Deploy using a string
uses: openfga/action-openfga-deploy@v0.1.0
with:
api-url: http://localhost:8080
api-token: ${{ secrets.KEY }}
store-id: ${{ env.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\"\}\]\}\}\}\}\]\}'
```
## License
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fopenfga%2Faction-openfga-deploy?ref=badge_large)