{"id":19830694,"url":"https://github.com/crytic/slither-docs-action","last_synced_at":"2025-05-01T15:30:28.896Z","repository":{"id":147013734,"uuid":"617473441","full_name":"crytic/slither-docs-action","owner":"crytic","description":"Write documentation for your code in pull requests using Slither and OpenAI.","archived":false,"fork":false,"pushed_at":"2023-11-20T17:01:37.000Z","size":1359,"stargazers_count":35,"open_issues_count":7,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T05:32:16.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crytic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-03-22T13:20:57.000Z","updated_at":"2025-01-23T20:36:41.000Z","dependencies_parsed_at":"2024-11-12T11:39:40.797Z","dependency_job_id":null,"html_url":"https://github.com/crytic/slither-docs-action","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fslither-docs-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fslither-docs-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fslither-docs-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fslither-docs-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crytic","download_url":"https://codeload.github.com/crytic/slither-docs-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251898497,"owners_count":21661837,"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":[],"created_at":"2024-11-12T11:24:47.012Z","updated_at":"2025-05-01T15:30:28.882Z","avatar_url":"https://github.com/crytic.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Document with Slither\n\nDocumenting your code can be tiresome. This action will help you write\ndocumentation for your code in pull requests using Slither and OpenAI. Just\nlabel your PR with `generate-docs` and the action will get it done!\n\nYou can see an example repository integrating this action here:\n[crytic/slither-docs-demo](https://github.com/crytic/slither-docs-demo). An\nexample [pull request](https://github.com/crytic/slither-docs-demo/pull/2)\nshowing the workflow in action is also available on that repository.\n\n\u003e **Note**\n\u003e\n\u003e As this action pushes the documentation to the same pull request branch, it\n\u003e only works on pull requests from the same repository. If you trigger the\n\u003e workflow on a pull request originating from a fork, it will display an error.\n\n## Usage\n\nThis action needs to be run on a `pull_request` event of type `labeled`. The\nworkflow needs to have `contents: write` permissions (to push documentation\ncommits to your PR) and `pull-requests: write` permissions (to untag and leave\ncomments on your PR)\n\nYou will also need an OpenAI API key. You can create one in the OpenAI website,\nby clicking on your profile picture, followed by the [\"View API\nkeys\"](https://platform.openai.com/account/api-keys) link.\n\n\u003e **Warning**\n\u003e\n\u003e This action will transmit code from your repository to OpenAI during normal\n\u003e operation. Review OpenAI's terms of service and privacy policy to see how your\n\u003e data will be processed, used, or stored.\n\nOnce you have acquired your API key, store it as an Actions secret for the\nGitHub repository. You may follow the instructions in the [GitHub\ndocumentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository)\nto do so.\n\n\u003e **Warning**\n\u003e\n\u003e The OpenAI API is a paid service. The requests that Slither performs to\n\u003e OpenAI's API endpoints cost money. Make sure you trust all the contributors\n\u003e with access to your repository, which may invoke this action with your API\n\u003e key. Configure adequate cost limits and alerts in OpenAI to avoid unexpected\n\u003e bills.\n\n```yaml\n- name: Document with Slither\n  uses: crytic/slither-docs-action@v0\n  with:\n    target: project\n    openai-api-key: ${{ secrets.OPENAI_API_KEY }}\n```\n\n### Options\n\n| Key              | Description\n|------------------|------------\n| `target`         | The path to the root of the project to be documented by Slither. It can be a directory or a file, and it defaults to the repo root.\n| `openai-api-key` | The OpenAI API key.\n| `trigger-label`  | The label used to trigger the action. `generate-docs` by default.\n| `slither-version`| The version of slither-analyzer to use. By default, the latest release in PyPI is used.\n| `solc-version`   | The version of `solc` to use. **This only has an effect if you are not using a compilation framework for your project** -- i.e., if `target` is a standalone `.sol` file.\n| `github-token`   | GitHub token, used to compute PR differences and push documentation. By default, it will use the workflow token, and there should be no need to override it.\n\n## Examples\n\nThese examples assume you have a valid OpenAI API key stored as a secret named\n`OPENAI_API_KEY` in your GitHub repository.\n\n### Example: Hardhat\n\n```yaml\nname: Document with Slither\n\non:\n  pull_request:\n    types: [labeled]\n    branches: [main]\n\njobs:\n  document:\n    name: Document with Slither\n    runs-on: ubuntu-latest\n    if: contains(github.event.pull_request.labels.*.name, 'generate-docs')\n    permissions:\n      contents: write\n      pull-requests: write\n\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v3\n\n      - name: Setup Node.js 16.x\n        uses: actions/setup-node@v3\n        with:\n          node-version: 16\n\n      - name: Install dependencies\n        working-directory: project\n        run: npm ci\n\n      - name: Document with Slither\n        uses: crytic/slither-docs-action@v0\n        with:\n          target: project\n          openai-api-key: ${{ secrets.OPENAI_API_KEY }}\n```\n\n### Example: Foundry\n\n```yaml\nname: Document with Slither\n\non:\n  pull_request:\n    types: [labeled]\n    branches: [main]\n\njobs:\n  document:\n    name: Document with Slither\n    runs-on: ubuntu-latest\n    if: contains(github.event.pull_request.labels.*.name, 'generate-docs')\n    permissions:\n      contents: write\n      pull-requests: write\n\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v3\n\n      - name: Install Foundry\n        uses: foundry-rs/foundry-toolchain@v1\n\n      - name: Document with Slither\n        uses: crytic/slither-docs-action@v0\n        with:\n          target: project\n          openai-api-key: ${{ secrets.OPENAI_API_KEY }}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrytic%2Fslither-docs-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrytic%2Fslither-docs-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrytic%2Fslither-docs-action/lists"}