This repository contains all the GitHub actions of the Scalingo organisation. Each action must be in a action.yml file located in a folder. The file name is a GitHub constraint.
See how it's used in the go-project-template.
The linter and tests GitHub actions have different options that can be enabled if needed:
- Linter:
sqlc: install sqlc and executesqlc diffto detect if a call tosqlc generateis missing. The default value isauto. With this value the action tries to automatically detect if sqlc is configured on the project and it is worth executing thediffcommand. Other possible options aretrueandfalse.
- Tests:
mongodb: run a MongoDB database so that unit tests can use it. An environment variableMONGO_URLis set in the unit tests execution environment with the connection string. The default value isauto. With this value the action tries to automatically detect if MongoDB is configured on the project. Other possible options aretrueandfalse.etcd: run a etcd single-node cluster reachable on127.0.0.1:2379. The default value isfalse. Other possible value istrueto run etcd.redis: run a Redis database reachable on127.0.0.1:6379. The default value isfalse. Other possible value istrueto run Redis.
Enable one of this option with:
jobs:
linter:
# ...
steps:
- uses: Scalingo/actions/go-linter@main
with:
- <option_name>: trueThe calling repository can customize the unit tests environment by adding a script bin/scalingo-ci-extra-setup.sh that is executed before the unit tests execution.
The Ruby checks and specs GitHub actions have different options that can be enabled if needed:
- Checks:
rubocop: execute RuboCop linter. The default value isauto. With this value the action tries to automatically detect if RuboCop is available in the bundle. Other possible options aretrueandfalse.brakeman: execute Brakeman security scanner. The default value isauto. With this value the action tries to automatically detect if Brakeman is available in the bundle. Other possible options aretrueandfalse.zeitwerk: execute Zeitwerk loader check. The default value isauto. With this value the action tries to automatically detect if thezeitwerk:checkrake task exists. Other possible options aretrueandfalse.
- Specs:
mongodb: run a MongoDB database so that specs can use it. An environment variable is set in the specs execution environment with the connection string. The default value isauto. With this value the action tries to automatically detect if MongoDB is configured on the project (by checking for themongoidgem inGemfile). Other possible options aretrueandfalse.redis: run a Redis database reachable on127.0.0.1:6379. The default value isauto. With this value the action tries to automatically detect if Redis is configured on the project (by checking for theredisgem inGemfile). Other possible options aretrueandfalse.pact: execute Pact verification after the specs if needed. The default value isauto. With this value the action tries to automatically detect if Pact is configured on the project (by checking for thepact:verifyrake task in the Rakefile). Other possible options aretrueandfalse.github_token: GitHub token for API access. It is used to upload code coverage status. If not set, the action doesn't upload code coverage status on github. Note: the permissionstatuses: writemust be granted to the GitHub token used in order to report coverage status.
Note
GitHub automatically creates a GITHUB_TOKEN for each job. You do not need to generate or store a separate token; pass it to this action with ${{ secrets.GITHUB_TOKEN }}.
Enable one of these options with:
jobs:
checks:
# ...
steps:
- uses: Scalingo/actions/ruby-checks@main
with:
- <option_name>: true | falsejobs:
specs:
# ...
steps:
- uses: Scalingo/actions/ruby-specs@main
with:
- <option_name>: true | falseTwo actions are present to release services which are go binaries:
- go-stable-release: Create a tag based on the name of the branch:
release/vX.Y.Zwhich got merged and create a stable Release using GoReleaser - go-rolling-release: Create a tag based on the name of the latest stable tag then create a prerelease Github Release using GoReleaser
Example of usage is presents in the actions.yml of each action
GitHub action to automatically merge the Dependabot PRs. It merges the dependency upgrade if it upgrades a minor or patch version.
See how it's used in the go-project-template.
GitHub Action to import a GPG key into the local agent, primarily used for signing Terraform provider releases.
A vendored copy of the peter-evans/create-pull-request
GitHub Action, used to create a pull request for changes made to the
repository during a workflow run. See create-pull-request/VENDORING.md
for why it is vendored here rather than referenced directly, and how to
update it. Refer to create-pull-request/README.md
for the full list of inputs and outputs.
jobs:
create-pr:
# ...
steps:
- uses: Scalingo/actions/create-pull-request@main
with:
title: "Automated changes"
commit-message: "chore: automated changes"The Ansible linter GitHub action wraps the official ansible/ansible-lint action so Scalingo repositories can reuse a pinned, shared configuration.
Available inputs:
-
args(opt):
Arguments passed toansible-lint.
Defaults to an empty string. -
working-directory(opt):
Directory whereansible-lintruns.
Defaults to the repository root. -
python-version(opt):
Python version used by the upstream action.
Defaults to3.14. -
setup-python(opt):
Whether Python should be installed before runningansible-lint.
Defaults totrue. -
requirements-file(opt):
Path to arequirements.ymlfile used to install roles and collections before linting.
Defaults to an empty string. -
files(opt):
Newline-separated list of files to lint, relative to the repository root.
When set, only these files are linted. Each line may be a literal path or a glob expression.
Defaults to an empty string, which lets ansible-linter discover files automatically.
Here is an example:
jobs:
ansible-lint:
runs-on: ubuntu-24.04
steps:
- uses: Scalingo/actions/ansible-linter@main
with:
working-directory: ansible
args: playbook.yml
requirements-file: requirements.ymlTo lint only changed files, pass the changed-file list with one path per line:
- uses: Scalingo/actions/ansible-linter@main
with:
working-directory: ansible
files: |
ansible/playbooks/site.yml
ansible/roles/web/tasks/main.ymlThe ShellCheck Github action allows to run ShellCheck on a repository.
Available inputs:
-
version(opt):
Allows to specify the version of ShellCheck to use.
Must be a valid Docker Hub release tag.
Defaults tov0.11.0 -
severity(opt):
Allows to specify the minimum severity of errors to consider.
Valid values in order of severity are:error,warning,infoandstyle.
Defaults tostyle. -
files(opt):
Allows to specify the path to the files to scan.
Paths must be given relative to the repository root directory.
They must be seperated by a newline.
Defaults to all.shfiles in the repository, except those in the.gitdirectory.
Here is an example:
jobs:
shellcheck:
name: "ShellCheck"
runs-on: ubuntu-24.04
steps:
- uses: Scalingo/actions/shellcheck@main
with:
severity: style
files: |
first_file.sh
second/*.sh
third.sh