Actions and Action Sets

An action set is a collection of one or more actions that are executed against a workload in response to an event. Actions and action sets are the meat of Expeditor and where most of the business logic resides.

There are three phases to the execution of an action set:

  1. Execute pre-commit actions
  2. Commit any modified files directly to master and push to GitHub
  3. Execute post-commit actions

One of the common use cases for Expeditor is the ability to modify your source code in response to an event (e.g. bump the version when a Pull Request is merged), commit the results of that modification, and then proceed with other activities. Here is an example of a common pattern in many of the projects that Expeditor manages.

subscriptions:
  - workload: pull_request_merged:{{agent_id}}:*
    actions:
      - built_in:bump_version
      - bash:.expeditor/update_version.sh
      - built_in:update_changelog
      - trigger_pipeline:omnibus/release:
          post_commit: true

The four actions specified here perform the following:

Action Result
built_in:bump_version Bump the patch version in the VERSION file (see docs).
bash:.expeditor/update_version.sh Run the bash script, which updates files in the repository with the new VERSION (see docs).
built_in:update_changelog Update the CHANGELOG.md file with details about the pull request that was just merged (see docs).
trigger_pipeline:omnibus/release Build a new release of our omnibus artifact (see docs).

Here is how those actions break out into pre- and post-commit actions:

Group Actions
pre-commit built_in:bump_version
bash:.expeditor/update_version.sh
built_in:update_changelog
Commit the files modified by pre-commit actions to master. Tag the commit if appropriate. Push to GitHub.
post-commit trigger_pipeline:omnibus/release

The actions you define in your action set are executed in the order they are specified while still respecting the deliniation between pre-commit and post-commit.

How does Expeditor know which actions should be run as pre-commit and post-commit?
The actions themselves have default values, but there is also an Action Filter that you can specify to control the behavior.