{"id":22041886,"url":"https://github.com/nekofar/action-usage-guard","last_synced_at":"2025-03-23T13:32:54.435Z","repository":{"id":183782629,"uuid":"670558555","full_name":"nekofar/action-usage-guard","owner":"nekofar","description":"GitHub Action to stop workflows beyond a certain usage limit.","archived":false,"fork":false,"pushed_at":"2024-05-23T09:03:38.000Z","size":199,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-23T09:52:59.024Z","etag":null,"topics":["actions","billing","monitor"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/nekofar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"nekofar","custom":"https://ud.me/nekofar.crypto"}},"created_at":"2023-07-25T10:17:33.000Z","updated_at":"2024-06-01T05:27:54.595Z","dependencies_parsed_at":"2024-01-06T19:35:44.937Z","dependency_job_id":"6222e1d7-9765-43e5-9cb6-9a98d0a9356f","html_url":"https://github.com/nekofar/action-usage-guard","commit_stats":null,"previous_names":["nekofar/action-usage-guard"],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekofar%2Faction-usage-guard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekofar%2Faction-usage-guard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekofar%2Faction-usage-guard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekofar%2Faction-usage-guard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nekofar","download_url":"https://codeload.github.com/nekofar/action-usage-guard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245108309,"owners_count":20562021,"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":["actions","billing","monitor"],"created_at":"2024-11-30T12:10:01.816Z","updated_at":"2025-03-23T13:32:54.414Z","avatar_url":"https://github.com/nekofar.png","language":"Shell","funding_links":["https://github.com/sponsors/nekofar","https://ud.me/nekofar.crypto"],"categories":[],"sub_categories":[],"readme":"# GitHub Action Usage Guard\n\n[![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/nekofar/action-usage-guard?include_prereleases)](https://github.com/nekofar/action-usage-guard/releases)\n[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/nekofar/action-usage-guard/prepare.yml)](https://github.com/nekofar/action-usage-guard/actions/workflows/prepare.yml)\n[![GitHub](https://img.shields.io/github/license/nekofar/action-usage-guard)](https://github.com/nekofar/action-usage-guard/blob/master/LICENSE)\n[![X (formerly Twitter) Follow](https://img.shields.io/badge/follow-%40nekofar-ffffff?logo=x\u0026style=flat)](https://x.com/nekofar)\n[![Donate](https://img.shields.io/badge/donate-nekofar.crypto-a2b9bc?logo=ko-fi\u0026logoColor=white)](https://ud.me/nekofar.crypto)\n\nA GitHub Action that cancels workflows if total account usage exceeds a defined threshold.\n\n## Usage\n\n```yaml\n# This is the name of your GitHub Actions workflow\nname: Main Workflow\n\n# This workflow gets triggered on every push to your repository\non: [push]\n\n# These are your workflow's jobs. Each job represents a process that your workflow will run.\njobs:\n  # This is the job for usage guard\n  guard:\n    # Runs the guard job on the latest Ubuntu version\n    runs-on: ubuntu-latest\n    steps:\n      # This step runs the Action Usage Guard\n      - name: Run Action Usage Guard\n        uses: nekofar/action-usage-guard@v1\n        with:\n          # GitHub access token for authentication.\n          token: ${{ secrets.ACCESS_TOKEN }}\n          # Defines the threshold for the usage guard.\n          threshold: 70\n\n  # This is the setup job\n  setup:\n    # The setup job requires the completion of the usage-guard job\n    needs: [ guard ]\n    # Runs the setup job on the latest Ubuntu version\n    runs-on: ubuntu-latest\n    steps:\n      # This is a step to check out the code\n      - name: Checkout code\n        uses: actions/checkout@v3\n\n      # This is a step with an example action\n      - name: Another Step\n        uses: actions/hello-world-docker-action@v1\n        with:\n          # This specifies who the action will 'greet'\n          who-to-greet: 'GitHub Actions'\n```\n\n## Token\n\nTo make use of this action, a **Fine-grained Personal Access Token (PAT)** is essential. The PAT needs to be configured differently based on whether it is for a user account or an organization account.\n\nIf you use it for a user account, you need **Read** access to plan, **Read** access to metadata, and **Read** and **Write** access to actions.\n\nIf you use it for an organization, you need **Read** access to organization administration, **Read** access to metadata, and **Read** and **Write** access to actions.\n\nMake sure to generate and handle the PAT securely, following the best practices for security. The access permissions can be managed by the user and organization administrators based on their security policies and requirements. If you require further assistance setting this up, please feel free to ask!\n\n## Options\n\nThe configuration used in the GitHub Action workflow includes several options for customization. Each of these\nconfiguration options has a specific use and can be tailored to suit your specific workflow needs. Below is a table\ndepicting these options:\n\n| Option       | Description                                                                                          |\n|--------------|------------------------------------------------------------------------------------------------------|\n| `token`      | This is the actual GitHub access token for authentication.                                           |\n| `threshold`  | (Optional) This defines the threshold value (1-100) for the usage guard action. The default is `70`. |\n\nEach option should be carefully considered to ensure that your workflow proceeds as expected.\n\n## Contributing\n\nWe value your input and help! If you're interested in contributing, please reference\nour [Contributing Guidelines](./CONTRIBUTING.md). Contributions aren't just about code - any bug reports, feedback, or\ndocumentation enhancements are welcomed. Thanks for helping to improve this project!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnekofar%2Faction-usage-guard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnekofar%2Faction-usage-guard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnekofar%2Faction-usage-guard/lists"}