Skip to content

Commit ac4261e

Browse files
authored
Merge pull request #1138 from fluxcd/backport-automation
Add backport GitHub Action workflow
2 parents 5fd4079 + 32be110 commit ac4261e

File tree

6 files changed

+142
-5
lines changed

6 files changed

+142
-5
lines changed

.github/dependabot.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
updates:
44
- package-ecosystem: "github-actions"
55
directory: "/"
6-
labels: ["area/build"]
6+
labels: ["area/ci", "dependencies"]
77
schedule:
8-
# by default this will be on a monday.
8+
# By default, this will be on a monday.
99
interval: "weekly"

.github/labels.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Configuration file to declaratively configure labels
2+
# Ref: https://github.com/EndBug/label-sync#Config-files
3+
4+
- name: area/bucket
5+
description: Bucket related issues and PRs
6+
color: '#169b4e'
7+
- name: area/ci
8+
description: Internal CI related issues and pull requests
9+
color: '#fccb4c'
10+
aliases: ['area/build']
11+
- name: area/docs
12+
description: Documentation related issues and PRs
13+
color: '#007bc7'
14+
- name: area/git
15+
description: Git related issues and PRs
16+
color: '#8762c7'
17+
- name: area/helm
18+
description: Helm related issues and PRs
19+
color: '#3c1f81'
20+
- name: area/oci
21+
description: OCI related issues and PRs
22+
color: '#d621a5'
23+
- name: area/security
24+
description: Security related issues and PRs
25+
color: '#e64c15'
26+
- name: area/storage
27+
description: Storage related issues and PRs
28+
color: '#707070'
29+
- name: area/testing
30+
description: (Unit) testing related issues and PRs
31+
color: '#e8c612'
32+
- name: backport:release/v1.0.x
33+
description: To be backported to release/v1.0.x
34+
color: '#ffa600'
35+
- name: blocked/needs-validation
36+
description: Requires wider review and validation
37+
color: '#ffc985'
38+
aliases: ['blocked-needs-validation']
39+
- name: blocked/upstream
40+
description: Blocked by an upstream dependency or issue
41+
color: '#a86fbb'
42+
aliases: ['blocked-upstream']
43+
- name: bug
44+
description: Something isn't working
45+
color: '#e63946'
46+
- name: dependencies
47+
description: Pull requests that update a dependency
48+
color: '#186faf'
49+
- name: duplicate
50+
description: This issue or pull request already exists
51+
color: '#c4c8cc'
52+
- name: enhancement
53+
description: New feature or request
54+
color: '#68c6e8'
55+
- name: experimental
56+
description: Issues and PRs related to experimental features
57+
color: '#e5437b'
58+
- name: good first issue
59+
description: Good for newcomers
60+
color: '#6074ff'
61+
- name: help wanted
62+
description: Extra attention is needed
63+
color: '#00a87b'
64+
- name: hold
65+
description: Issues and pull requests put on hold
66+
color: '#e64c15'
67+
- name: invalid
68+
description: This doesn't seem right
69+
color: '#ffffff'
70+
- name: question
71+
description: Further information is requested
72+
color: '#e175e5'
73+
- name: umbrella-issue
74+
description: Umbrella issue for tracking progress of a larger effort
75+
color: '#b162a9'
76+
- name: wontfix
77+
description: This will not be worked on
78+
color: '#c4c8cc'

.github/workflows/backport.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: backport
2+
3+
on:
4+
pull_request_target:
5+
types: [closed, labeled]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
backport:
12+
name: Backport pull request
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
if: github.event.pull_request.state == 'closed' && github.event.pull_request.merged && (github.event_name != 'labeled' || startsWith('backport:', github.event.label.name))
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
21+
with:
22+
ref: ${{ github.event.pull_request.head.sha }}
23+
- name: Create backport PRs
24+
uses: korthout/backport-action@bf5fdd624b35f95d5b85991a728bd5744e8c6cf2 # v1.3.1
25+
# xref: https://github.com/korthout/backport-action#inputs
26+
with:
27+
# Match labels with a pattern `backport:<target-branch>`
28+
label_pattern: '^backport:([^ ]+)$'
29+
# A bit shorter pull-request title than the default
30+
pull_title: '[${target_branch}] ${pull_title}'
31+
# Simpler PR description than default
32+
pull_description: |-
33+
Automated backport to `${target_branch}`, triggered by a label in #${pull_number}.

.github/workflows/cifuzz.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CIFuzz
1+
name: fuzz
22
on:
33
pull_request:
44
branches:
@@ -12,7 +12,7 @@ permissions:
1212
contents: read
1313

1414
jobs:
15-
Fuzzing:
15+
smoketest:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout

.github/workflows/scan.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Scan
1+
name: scan
22

33
on:
44
push:

.github/workflows/sync-labels.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: sync-labels
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- .github/labels.yaml
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
labels:
15+
name: Run sync
16+
runs-on: ubuntu-latest
17+
permissions:
18+
issues: write
19+
steps:
20+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
21+
- uses: EndBug/label-sync@da00f2c11fdb78e4fae44adac2fdd713778ea3e8 # v2.3.2
22+
with:
23+
# Configuration file
24+
config-file: .github/labels.yaml
25+
# Strictly declarative
26+
delete-other-labels: true

0 commit comments

Comments
 (0)