Forge Home

github_actions_runner

Module to configure our GitHub Actions runner on Debian hosts

274 downloads

198 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.1.0 (latest)
  • 1.0.0
released Aug 27th 2024
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0
  • , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'puppet-github_actions_runner', '1.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppet-github_actions_runner
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppet-github_actions_runner --version 1.1.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

puppet/github_actions_runner — version 1.1.0 Aug 27th 2024

GitHub Actions Runner

Build Status Release Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores puppetmodule.info docs Apache-2.0 License Migrated from Telefonica

Automatic configuration for running GitHub Actions as a service

Table of Contents

Description

This module will setup all of the files and configuration needed for GitHub Actions runner to work on Debian (Stretch and Buster) and CentOS7 hosts.

hiera configuration examples

This module supports configuration through hiera.

Creating an organization level Actions runner

github_actions_runner::ensure: present
github_actions_runner::base_dir_name: '/data/actions-runner'
github_actions_runner::package_name: 'actions-runner-linux-x64'
github_actions_runner::package_ensure: '2.277.1'
github_actions_runner::repository_url: 'https://github.com/actions/runner/releases/download'
github_actions_runner::org_name: 'my_github_organization'
github_actions_runner::personal_access_token: 'PAT'
github_actions_runner::user: 'root'
github_actions_runner::group: 'root'
github_actions_runner::instances:
  example_org_instance:
    labels:
      - self-hosted-custom
    runner_group: 'MyRunners'

Note, your personal_access_token has to contain the admin:org permission.

Creating an additional repository level Actions runner

github_actions_runner::instances:
  example_org_instance:
    labels:
      - self-hosted-custom1
  example_repo_instance:
    repo_name: myrepo
    labels:
      - self-hosted-custom2

Note, your personal_access_token has to contain the repo permission.

Instance level overwrites

github_actions_runner::instances:
  example_org_instance:
    ensure: absent
    labels:
      - self-hosted-custom1
  example_repo_instance:
    org_name: overwritten_orgnization
    repo_name: myrepo
    labels:
      - self-hosted-custom2

Adding a global proxy and overwriting an instance level proxy

github_actions_runner::http_proxy: http://proxy.local
github_actions_runner::https_proxy: http://proxy.local
github_actions_runner::instances:
  example_org_instance:
    http_proxy: http://instance_specific_proxy.local
    https_proxy: http://instance_specific_proxy.local
    no_proxy: example.com
    labels:
      - self-hosted-custom1

Github Enterprise examples

To use the module with Github Enterprise Server, you have to define these parameters:

github_actions_runner::github_domain: "https://git.example.com"
github_actions_runner::github_api: "https://git.example.com/api/v3"

In addition to the runner configuration examples above, you can also configure runners on the enterprise level by setting a value for enterprise_name, for example:

github_actions_runner::ensure: present
github_actions_runner::base_dir_name: '/data/actions-runner'
github_actions_runner::package_name: 'actions-runner-linux-x64'
github_actions_runner::package_ensure: '2.277.1'
github_actions_runner::repository_url: 'https://github.com/actions/runner/releases/download'
github_actions_runner::enterprise_name: 'enterprise_name'
github_actions_runner::personal_access_token: 'PAT'
github_actions_runner::user: 'root'
github_actions_runner::group: 'root'
github_actions_runner::instances:

Note, your personal_access_token has to contain the admin:enterprise permission.

Update PATH used by Github Runners

By default, puppet will not modify the values that the runner scripts create when the runner is set.

In case you need to use another value of paths in the environment variable PATH, you can define through hiera. For example:

  • For all runners defined:
    github_actions_runner::path:
      - /usr/local/bin
      - /usr/bin
      - /bin
      - /my/own/path
    
  • For just a specific runner:
    github_actions_runner::instances:
      example_org_instance:
        path:
          - /usr/local/bin
          - /usr/bin
          - /bin
          - /my/own/path
        labels:
          - self-hosted-custom
    

Adding environment variables to runner

The runner uses environment variables to decide pre/post-run scripts: https://docs.github.com/en/actions/hosting-your-own-runners/running-scripts-before-or-after-a-job#triggering-the-scripts

github_actions_runner::env:
  ACTIONS_RUNNER_HOOK_JOB_STARTED: "/cleanup_script"
  FOO: "bar"

Limitations

Tested on Debian 9 (stretch), Debian 10 (buster) and CentOS7 hosts. Full list of operating systems support and requirements are described in metadata.json file.

Development

There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. For more information, see Puppet Forge module contribution guide.

License

GitHub Actions Runner is available under the Apache License, Version 2.0. See LICENSE file for more info.

Transfer Notice

This module was originally written by Telefonica:

https://github.com/Telefonica/puppet-github-actions-runner

They archived the repository and Vox Pupuli forked it in August 2024.