Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
activity

GitHub Action

Action Usage Guard

v1.0.0-beta.2 Pre-release

Action Usage Guard

activity

Action Usage Guard

A GitHub Action that cancels workflows if total account usage exceeds a defined threshold

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Action Usage Guard

uses: nekofar/[email protected]

Learn more about this action in nekofar/action-usage-guard

Choose a version

GitHub Action Usage Guard

GitHub release (latest SemVer including pre-releases) GitHub Workflow Status (branch) GitHub Twitter Follow Donate

A GitHub Action that cancels workflows if total account usage exceeds a defined threshold.

Usage

# This is the name of your GitHub Actions workflow
name: Main Workflow

# This workflow gets triggered on every push to your repository
on: [push]

# These are your workflow's jobs. Each job represents a process that your workflow will run.
jobs:
  setup:
    # Runs the job on the latest Ubuntu version
    runs-on: ubuntu-latest
    steps:
      # This is a step to checkout the code
      - name: Checkout code
        uses: actions/checkout@v3

      # Uses the action-usage-guard action
      - name: Run Action Usage Guard
        uses: nekofar/action-usage-guard@v1
        with:
          # GitHub access token for authentication.
          token: ${{ secrets.ACCESS_TOKEN }}
          # Defines the threshold for the usage guard.
          threshold: 70

      # You can add as many steps as you want. Here is another example step.
      - name: Another Step
        # For illustration, we use actions/hello-world-docker-action
        uses: actions/hello-world-docker-action@v1
        with:
          who-to-greet: 'GitHub Actions'

Options

The configuration used in the GitHub Action workflow includes several options for customization. Each of these configuration options has a specific use and can be tailored to suit your specific workflow needs. Below is a table depicting these options:

Option Description
token This is the actual GitHub access token for authentication.
threshold (Optional) This defines the threshold value (1-100) for the usage guard action. The default is 70.

Each option should be carefully considered to ensure that your workflow proceeds as expected.

Contributing

We value your input and help! If you're interested in contributing, please reference our Contributing Guidelines. Contributions aren't just about code - any bug reports, feedback, or documentation enhancements are welcomed. Thanks for helping to improve this project!