Merge pull request #46830 from ceph/backport-doc-pr

.github: Automatically backport doc/releases PRs
This commit is contained in:
David Galloway 2022-06-24 11:06:22 -04:00 committed by GitHub
commit 8db6d89196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 0 deletions

9
.github/labeler.yml vendored
View File

@ -1,6 +1,15 @@
api-change:
- src/pybind/mgr/dashboard/openapi.yaml
backport quincy:
- doc/releases/**
backport pacific:
- doc/releases/**
backport octopus:
- doc/releases/**
build/ops:
- "**/CMakeLists.txt"
- admin/**

26
.github/workflows/backport.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Automatically backport labeled PRs
on:
pull_request_target:
types:
- closed
- labeled
jobs:
backport:
name: Backport
runs-on: ubuntu-latest
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
steps:
- uses: tibdex/backport@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -0,0 +1,21 @@
---
name: "Label doc/releases PRs so our backport GitHub Action picks them up"
on:
pull_request:
types:
- closed
branches:
- main
paths:
- 'doc/releases/**'
jobs:
if_merged:
runs-on: ubuntu-latest
steps:
- name: Assign labels based on modified files
uses: actions/labeler@9794b1493b6f1fa7b006c5f8635a19c76c98be95
with:
sync-labels: ''
repo-token: "${{ secrets.GITHUB_TOKEN }}"