Stash Actions administrator guide

Stash Actions provides continuous integration driven from the files found in the .stash/workflows directory of a repository. Note that Stash does not run the jobs, it relies on the Stash Runner to do so.

Stash Runner

The Stash Runner is a program that fetches workflows to run from a Stash instance and executes them. It is installed and configured separately from Stash.

To get started with Stash Runner:

  1. Install Stash Runner
  2. Register Stash Runner to connect it to Stash,
  3. Configure Stash Runner to define what jobs it executes and how it operates.

A single Stash Runner can be connected to multiple Stash instances, or different users, organizations, or repositories within a single instance. Multiple Stash Runner installations can be connected to a single Stash instance to distribute jobs over a cluster of available compute resources.

Stash Runner performs remote code execution. That poses significant security threats for the host and network that it operates upon. Securing Stash Actions Deployments walks through the security considerations and choices that an administrator should be aware of.

To build container images in workflows or run actions that use Docker, additional configuration is required.

Stash Settings

Enabling/Disabling

As of Stash v1.21, Actions is enabled by default. It can be disabled by adding the following to app.ini:

[actions]
ENABLED = false

Default Actions URL

In a workflow, when uses: does not specify an absolute URL, the value of DEFAULT_ACTIONS_URL is prepended to it.

[actions]
ENABLED = true
DEFAULT_ACTIONS_URL = https://data.stash.org

The actions published at https://data.stash.org are:

  • known to work with Stash Actions
  • published under a Free Software license

They can be found in organizations such as actions for general purpose actions, docker for those related to Docker and so on.

When setting DEFAULT_ACTIONS_URL to a Stash instance with an open registration, care must be taken to avoid name conflicts. For instance if an action has uses: foo/bar@main it will clone and try to run the action found at DEFAULT_ACTIONS_URL/foo/bar if it exists, even if it provides something different than what is expected.

Storage

The logs and artifacts are stored in Stash. The cache is stored by the runner itself and never sent to Stash.

job logs

The logs of each job run is stored by the Stash server and expire after a delay that defaults to 365 days and can be configured as follows:

[actions]
LOG_RETENTION_DAYS = 365

The location where these files are stored is configured in the storage.actions_log section of app.ini as explained in in the storage documentation.

artifacts logs

The artifacts uploaded by a job are stored by the Stash server and expire after a delay that defaults to 90 days and can be configured as follows:

[actions]
ARTIFACT_RETENTION_DAYS = 90

The location where these artifacts are stored is configured in the storage.artifacts section of app.ini as explained in in the storage documentation.

The admin/monitor/cron administration web interface can be used to manually trigger the Cleanup actions expired logs and artifacts task instead of waiting for the scheduled task to happen.

Other runners

It is possible to use other runners instead of Stash Runner. As long as they can connect to a Stash instance using the same protocol, they will be given tasks to run.