{"id":22918304,"url":"https://github.com/theztefan/rulesets-as-code-action","last_synced_at":"2025-04-01T13:17:11.297Z","repository":{"id":252397068,"uuid":"840223792","full_name":"theztefan/rulesets-as-code-action","owner":"theztefan","description":"GitHub Action to manage organization GitHub Rulesets as code.","archived":false,"fork":false,"pushed_at":"2025-02-03T01:27:54.000Z","size":2342,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T08:14:29.364Z","etag":null,"topics":["rulesets"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theztefan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-09T08:29:20.000Z","updated_at":"2024-12-23T10:57:21.000Z","dependencies_parsed_at":"2024-08-09T14:19:37.694Z","dependency_job_id":"7e674169-2b53-4670-aa3c-9eb05e58cca8","html_url":"https://github.com/theztefan/rulesets-as-code-action","commit_stats":null,"previous_names":["theztefan/rulesets-as-code-action"],"tags_count":0,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theztefan%2Frulesets-as-code-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theztefan%2Frulesets-as-code-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theztefan%2Frulesets-as-code-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theztefan%2Frulesets-as-code-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theztefan","download_url":"https://codeload.github.com/theztefan/rulesets-as-code-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246644099,"owners_count":20810687,"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","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":["rulesets"],"created_at":"2024-12-14T06:29:52.753Z","updated_at":"2025-04-01T13:17:11.279Z","avatar_url":"https://github.com/theztefan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rulesets-as-Code Action\n\nThis is a GitHub Actions that allows you to manage your GitHub Rulesets via\ncode. It is a simple action that enables you to establish a workflow where a\nruleset definition is stored in a `json` file and any change to it needs to be\nvalidated and approved by CODEOWNERS before it gets deployed as a change to the\nOrganization.\n\nTo update the organization the Action will use the available REST APIs:\n\n- [Get an organization repository ruleset](https://docs.github.com/en/rest/orgs/rules?apiVersion=2022-11-28#get-an-organization-repository-ruleset)\n- [Update an organization repository rules](https://docs.github.com/en/rest/orgs/rules?apiVersion=2022-11-28#update-an-organization-repository-ruleset)\n\n## Inputs\n\n- `ruleset-file-path`: Path to the local ruleset file.\n- `token`: GitHub token for authentication.\n- `organization`: GitHub organization name (optional).\n\n## Usage\n\nThe idea is to run this action in a central Rulset governing reporsitory for\nyour organization. It can either be an existing repository where you manage\nother policies or a dedicated new repository that you created for this purpose.\n\n```yaml\nname: Manage Organization Rulesets\non:\n  push:\n    branches: [main]\n    paths: [ruleset.json]\njobs:\n  ruleset-check:\n    runs-on: ubuntu-latest\n    permissions: read-all\n    steps:\n      - name: Checkout\n        id: checkout\n        uses: actions/checkout@v4\n\n      - name: Generate App Token\n        id: app-token\n        uses: actions/create-github-app-token@v1\n        with:\n          app-id: ${{ secrets.APP_ID }}\n          private-key: ${{ secrets.APP_KEY }}\n\n      - name: Rulesets as Code\n        id: rulesets-as-code\n        uses: theztefan/rulesets-as-code-action@main\n        with:\n          ruleset-file-path: 'ruleset.json'\n          token: ${{ steps.app-token.outputs.token }}\n          organization: 'your-organization'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheztefan%2Frulesets-as-code-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheztefan%2Frulesets-as-code-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheztefan%2Frulesets-as-code-action/lists"}