{"id":28403847,"url":"https://github.com/openfga/action-openfga-test","last_synced_at":"2025-10-08T22:08:37.197Z","repository":{"id":216353349,"uuid":"741040499","full_name":"openfga/action-openfga-test","owner":"openfga","description":"Github Action for testing your OpenFGA Authorization Model","archived":false,"fork":false,"pushed_at":"2025-09-18T23:07:25.000Z","size":70,"stargazers_count":6,"open_issues_count":3,"forks_count":6,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-09-19T01:19:17.842Z","etag":null,"topics":["authorization","fine-grained-authorization","github-action","zanzibar"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openfga.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY-INSIGHTS.yml","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-09T15:21:33.000Z","updated_at":"2025-08-08T19:33:12.000Z","dependencies_parsed_at":"2024-01-09T19:56:35.048Z","dependency_job_id":"9d44ff7d-8657-450a-bf69-1d63402483e8","html_url":"https://github.com/openfga/action-openfga-test","commit_stats":null,"previous_names":["openfga/action-openfga-test"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/openfga/action-openfga-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Faction-openfga-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Faction-openfga-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Faction-openfga-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Faction-openfga-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfga","download_url":"https://codeload.github.com/openfga/action-openfga-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Faction-openfga-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000778,"owners_count":26082851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authorization","fine-grained-authorization","github-action","zanzibar"],"created_at":"2025-06-01T19:11:02.627Z","updated_at":"2025-10-08T22:08:37.192Z","avatar_url":"https://github.com/openfga.png","language":null,"readme":"# OpenFGA Github Action - Test\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fopenfga%2Faction-openfga-test.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fopenfga%2Faction-openfga-test?ref=badge_shield)\n\nThis action can be used to test your authorization model using store test files.\n\n## Parameter\n\n| Parameter             | Description                                                                                                                                                                                                                                                                                                                  | Required | Default      |\n|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|--------------|\n| `test_path`           | The path to your store test file or folder relative to the root of your project.                                                                                                                                                                                                                                             | No       | `.`          |\n| `test_files_pattern`  | The pattern to match test files.                                                                                                                                                                                                                                                                                             | No       | `*.fga.yaml` |\n| `fga_server_url`      | The OpenFGA server to test the Authorization Model against. If empty (which is the default value), the tests are run using the cli built-in OpenFGA instance. If specified, it is mandatory to specify the store id with the `fga_server_store_id` input, also the `model` and `model_file` entries of the tests are ignored | No       | _empty_      |\n| `fga_server_store_id` | The OpenFGA server store id. Must be provided if fga_server_url is configured.                                                                                                                                                                                                                                               | No       | _empty_      |\n| `fga_api_token`       | The api token to use for testing against an OpenFGA server. Ignored if `fga_server_url` is not provided.                                                                                                                                                                                                                     | No       | _empty_      |\n\n\u003e Note: the action will fail if no test is found in the specified test path with the given pattern\n\n## Examples\n\n### Running tests of `*.fga.yaml` files present in the repository\n\n```yaml\nname: Test Action\n\non:\n  workflow_dispatch:\n\njobs:\n  test:\n    name: Run test\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: openfga/action-openfga-test@v0.1.1\n```\n\n### Running tests of `*.fga.yaml` files present in a given folder\n\n```yaml\nname: Test Action\n\non:\n  workflow_dispatch:\n\njobs:\n  test:\n    name: Run test\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: openfga/action-openfga-test@v0.1.1\n        with:\n          test_path: example\n```\n\n### Running tests of a single file\n\n```yaml\nname: Test Action\n\non:\n  workflow_dispatch:\n\njobs:\n  test:\n    name: Run test\n    runs-on: ubuntu-latest\n    steps:\n      - uses: openfga/action-openfga-test@v0.1.1\n        with:\n          test_path: example/model.fga.yaml\n```\n\n### Running tests against a given version of OpenFGA\n\n```yaml\nname: Test Action\n\non:\n  workflow_dispatch:\n\njobs:\n  test:\n    name: Run test\n    runs-on: ubuntu-latest\n    services:\n      postgres:\n        image: postgres:14\n        env:\n          POSTGRES_USER: openfga\n          POSTGRES_PASSWORD: '1234'\n        ports:\n          - 5432:5432\n        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5\n    env:\n      OPENFGA_DATASTORE_ENGINE: 'postgres'\n      OPENFGA_DATASTORE_URI: 'postgres://openfga:1234@127.0.0.1:5432/openfga'\n      OPENFGA_LOG_LEVEL: debug\n    steps:\n      - uses: actions/checkout@v4\n      - name: Install OpenFGA server v1.5.3\n        uses: jaxxstorm/action-install-gh-release@v1.11.0\n        with:\n          repo: openfga/openfga\n          tag: v1.5.3\n          cache: enable\n      - name: Migrate OpenFGA database\n        shell: bash\n        run: openfga migrate\n      - name: Start OpenFGA server in background\n        shell: bash\n        run: openfga run \u0026\n      - name: Install OpenFGA cli\n        uses: jaxxstorm/action-install-gh-release@v1.11.0\n        with:\n          repo: openfga/cli\n          cache: enable\n      - name: Install jq\n        uses: dcarbone/install-jq-action@v2\n      - name: Create store with model\n        id: 'store'\n        run: |\n          fga store create --model ./example/model_with_conditions.fga \u003e store_response.json\n          cat store_response.json\n          store_id= $(jq -r '.store.id' store_response.json)\n          echo \"store_id=${store_id}\" \u003e\u003e $GITHUB_OUTPUT\n      - name: Run tests\n        uses: openfga/action-openfga-test@v0.1\n        with:\n          fga_server_url: 'http://localhost:8080'\n          fga_server_store_id: ${{ steps.store.outputs.store_id }}\n```\n\n## License\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fopenfga%2Faction-openfga-test.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fopenfga%2Faction-openfga-test?ref=badge_large)\n","funding_links":[],"categories":["\u003ca name=\"Not%20Set\"\u003e\u003c/a\u003eNot Set"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfga%2Faction-openfga-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfga%2Faction-openfga-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfga%2Faction-openfga-test/lists"}