Skip to content

🦮 GitHub Action that links upstream Pull Requests with downstream backports

License

Notifications You must be signed in to change notification settings

redhat-plumbers-in-action/downstream-backport-helper

Repository files navigation

Downstream Backport Helper

GitHub Marketplace Lint Code Base Unit Tests CodeQL Check dist/

codecov

Features

Usage

This action is intended to be used in the upstream repository to help maintainers and contributors backport changes to the downstream (stable) repositories or branches. It is designed to be run on a schedule; see the example below.

name: Stable Backport Helper

on:
  schedule:
    # every hour
    - cron: "0 * * * *"

permissions:
  contents: read

jobs:
  stable-backport-helper:
    runs-on: ubuntu-latest

    permissions:
      pull-requests: write

    steps:
      - uses: jamacku/downstream-backport-helper@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

We also need to create a configuration file .github/downstream-backport-helper.yml:

downstream:
  - owner: systemd
    repo: systemd-stable
    branches:
      - '*-stable'
  - owner: systemd
    repo: systemd
    branches:
      - '*-stable'
    status-title: 'systemd-stable'
lookup-interval: 7

Configuration options

Action currently accepts the following options:

# ...

- uses: redhat-plumbers-in-action/downstream-backport-helper@v1
  with:
    config-path:  <path to config file>
    token:        <GitHub token or PAT>

# ...

config-path

The path to the configuration file. The configuration file format is described in the Config section.

  • default value: .github/downstream-backport-helper.yml
  • requirements: optional

token

A GitHub token or PAT is used to create labels and comments on Pull Request.

# required permission
permissions:
  pull-requests: write
  • default value: undefined
  • requirements: required
  • recomended value: secrets.GITHUB_TOKEN

Config

Action is configured using a special config file: .github/downstream-backport-helper.yml. The structure needs to be as follows:

downstream:
  - git-server: https://github.com
    owner: systemd
    repo: systemd-stable
    branches:
      - '*-stable'
  - owner: systemd
    repo: systemd
    branches:
      - '*-stable'
    status-title: 'systemd-stable'
lookup-interval: 7

downstream keyword

The array of objects that describe downstream repositories that action will monitor for backports.

git-server keyword

The Git server URL where the downstream repository is located.

Note

This is currently tested only with GitHub repositories.

  • default value: https://github.com
  • requirements: optional

owner keyword

The owner of the downstream repository.

  • default value: undefined
  • requirements: required

repo keyword

The name of the downstream repository.

  • default value: undefined
  • requirements: required

branches keyword

The array of branch names that are considered stable branches or branches where the backports commits are applied.

  • default value: undefined
  • requirements: required

status-title keyword

The title of the status that will be created on the upstream PRs. It is used to mark the PRs that have already been backported to the downstream repository.

  • default value: <owner>/<repo>
  • requirements: optional

lookup-interval keyword

The number of days that the action will look back in the history of the downstream repository to find the backported commits.

  • default value: 7
  • requirements: optional

About

🦮 GitHub Action that links upstream Pull Requests with downstream backports

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •