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
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>
# ...
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
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
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
The array of objects that describe downstream repositories that action will monitor for backports.
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
The owner of the downstream repository.
- default value:
undefined
- requirements:
required
The name of the downstream repository.
- default value:
undefined
- requirements:
required
The array of branch names that are considered stable branches or branches where the backports commits are applied.
- default value:
undefined
- requirements:
required
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
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