Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Commit f667f2c

Browse files
committed
ci: Allow auto-backporting using labels
Allows automatic backport of merged PRs based on the labels assigned. Same as is currently done in e.g. trustify-ui: - https://github.com/trustification/trustify-ui/blob/main/.github/workflows/pr-closed.yaml
1 parent 071eef5 commit f667f2c

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/pr-closed.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: PR Closed
2+
3+
on:
4+
pull_request_target:
5+
branches:
6+
- main
7+
types:
8+
- closed
9+
issue_comment:
10+
types:
11+
- created
12+
13+
jobs:
14+
cherry_pick_job:
15+
permissions:
16+
pull-requests: write
17+
contents: write
18+
# Only run when pull request is merged
19+
# or when a comment starting with `/backport` is created by someone other than the
20+
# https://github.com/apps/trustification-ci-bot bot user (user id: 199085543). Note that if you use your
21+
# own PAT as `github_token`, that you should replace this id with yours.
22+
# To get Github App user id we can do: 'curl -H "Authorization: Bearer token" -s https://api.github.com/users/trustification-ci-bot%5Bbot%5D'
23+
if: >
24+
(
25+
github.event_name == 'pull_request_target' &&
26+
github.event.pull_request.merged
27+
) || (
28+
github.event_name == 'issue_comment' &&
29+
github.event.issue.pull_request &&
30+
github.event.comment.user.id != 199085543 &&
31+
startsWith(github.event.comment.body, '/backport')
32+
)
33+
secrets: inherit
34+
uses: trustification/release-tools/.github/workflows/backport.yaml@main

0 commit comments

Comments
 (0)