GitHub Push Trigger

See related documentation on getting started with GitHub and on event triggers.

Placing the following snippet at the top of an RWX file will result in all tasks in the file running on every GitHub push.

on:
  github:
    push:

It's common to pass values from the event as init parameters into tasks.

on:
  github:
    push:
      init:
        commit-sha: ${{ event.git.sha }}

base:
  os: ubuntu 24.04
  tag: 1.2

tasks:
  - key: code
    call: git/clone 1.6.9
    with:
      repository: https://github.com/YOUR_ORG/PROJECT.git
      ref: ${{ init.commit-sha }}
      github-access-token: ${{ github.token }}

Merge Groups

GitHub merge groups are used for testing multiple pull requests together before merging. This is particularly useful for repositories that use merge queues to maintain a linear history.

To trigger a run on a merge group event, you can use the following snippet, which leverages the special branch prefix GitHub provides for merge groups.

on:
  github:
    push:
      - if: ${{ starts-with(event.git.branch, 'gh-readonly-queue/') }}
        init:
          commit-sha: ${{ event.git.sha }}

Event Fields

The following fields are available on GitHub Push events.

attributedescription
event.git.branchThe name of the branch that was pushed (set to an empty string if a branch was not pushed)
event.git.shaThe SHA of the most recent commit on ref after the push
event.git.refThe full git ref that was pushed. Example: refs/heads/main or refs/tags/v3.14.1.
event.git.tagThe name of the tag that was pushed (set to an empty string if a tag was not pushed)
event.github.push.head_commit.messageThe commit message of the head commit.
event.github.push.repository.clone_urlThe https URL that can be used to clone the repository.
event.github.push.sender.loginThe GitHub username of the user who pushed.

For the full set of attributes available within event.github.push, see GitHub's documentation on push webhooks