Skip to content

drudilorenzo/clean-up-offline-github-runners

Repository files navigation

Clean-up-offline-github-runners

GitHub Actions JavaScript License: MIT Stable Version Latest Release

JavaScript Github Action to clean up offline self-hosted runners linked to a repository.

  1. Prerequisites
  2. Explanation
  3. How-to-use

Prerequisites

  1. You have a repository where you use self-hosted runners.
  2. You have a github app linked to that repository.
  3. You have added secrets to your repository that are later used to set environment variables. More information on secrets: How to set up secrets.

Inputs

Everything below is required. There are no default values provided.

  • repo-name: The name of the repository for which you want to clean up offline runners
  • repo-owner: The owner of the repository for which you want to clean up offline runners

Environment Variables

  • APP_ID: GitHub App ID
  • APP_PRIVATE_KEY: GitHub App Private Key

Example Usage

name: clean-up-runners
on: <event on which the action has to start>
jobs:
    manage-runners:
        runs-on: ubuntu-latest
        steps:
          - uses: LorenzoDrudi/clean-up-offline-github-runners@<version to use>
            env:
              APP_ID: ${{ secrets.APP_ID }}
              APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
            with:
              repo-name: <name of the repository for which you want to clean up offline runners>
              repo-owner: <owner of the repository for which you want to clean up offline runners>

All the personal inputs are passed by github secret. See the docs.

Tags and Releases

A github action workflow automatically creates a Tag and a Release every push on the main branch.
That's only a good DevOps practice, furthermore the main branch is protected and changes can come only over PR.
The idea is to work on develop/features branches and when it's done merge to the main branch, so the workflow starts.

The default behaviour is to create a minor tag/release (e.g. 1.*.0), the schema is <major_version>.<minor_version>.<patch_version>.
It's possible also to create major or patch tags/releases adding a tag at the end of the commit message:

  • #major -> e.g. *.0.0
  • #patch -> e.g. 1.1.*

For more info see the references.

References

About

Javascript github action to clean up offline self-hosted runners.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •