GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Forward port 5.0: Add more porting workflows (#16287) · netty/netty@52a8d4e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • backport-41.yml
    • backport-42.yml
    • forwardport-50.yml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/backport-41.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/backport-41.yml
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
backport:
1212
name: "Backporting to 4.1"
1313
concurrency:
14-
group: backporting-${{ github.event.pull_request.number }}
14+
group: port-41-${{ github.event.pull_request.number }}
1515
cancel-in-progress: true
1616
if: github.event.pull_request.merged && contains(github.event.pull_request.labels.*.name, 'needs-cherry-pick-4.1')
1717
runs-on: ubuntu-latest
@@ -57,6 +57,7 @@ jobs:
5757
fi
5858
5959
- name: Create pull request
60+
id: create-pr
6061
if: steps.cherry-pick.outcome == 'success'
6162
uses: actions/github-script@v8
6263
with:
@@ -103,3 +104,8 @@ jobs:
103104
body: `Could not create automatic backport PR.\n`+
104105
`I could cherry-pick onto 4.1 just fine, but pushing the new branch failed.`
105106
});
107+
108+
- name: Remove branch on PR create failure
109+
if: failure() && steps.create-pr.outcome != 'success'
110+
run: |
111+
git push -d origin "${{ steps.cherry-pick.outputs.branch }}"
Collapse file

‎.github/workflows/backport-42.yml‎

Copy file name to clipboard
+112Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Auto Backport to 4.2
2+
on:
3+
pull_request_target:
4+
types:
5+
- closed
6+
- labeled
7+
branches:
8+
- '5.0'
9+
10+
jobs:
11+
backport:
12+
name: "Backporting to 4.2"
13+
concurrency:
14+
group: port-42-${{ github.event.pull_request.number }}
15+
cancel-in-progress: true
16+
if: github.event.pull_request.merged && contains(github.event.pull_request.labels.*.name, 'needs-cherry-pick-4.2')
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v6
21+
with:
22+
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_PEM }}
23+
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
24+
fetch-depth: '0' # Cherry-pick needs full history
25+
26+
- name: Setup git configuration
27+
run: |
28+
git config --global user.email "[email protected]"
29+
git config --global user.name "Netty Project Bot"
30+
31+
- name: Create backport PR branch and cherry-pick
32+
id: cherry-pick
33+
run: |
34+
MERGE_COMMIT="${{ github.event.pull_request.merge_commit_sha }}"
35+
echo "Backporting commit: $MERGE_COMMIT"
36+
37+
BACKPORT_BRANCH="backport-pr-${{ github.event.pull_request.number }}-to-4.2"
38+
git fetch origin 4.2:4.2
39+
git checkout -b "$BACKPORT_BRANCH" 4.2
40+
41+
if git cherry-pick -x "$MERGE_COMMIT"; then
42+
echo "Cherry-pick successful"
43+
else
44+
echo "Cherry-pick failed - conflicts detected"
45+
git cherry-pick --abort
46+
exit 1
47+
fi
48+
echo "branch=$BACKPORT_BRANCH" >> "$GITHUB_OUTPUT"
49+
50+
- name: Push backport branch
51+
id: push
52+
if: steps.cherry-pick.outcome == 'success'
53+
run: |
54+
if ! git push origin "${{ steps.cherry-pick.outputs.branch }}"; then
55+
echo "Backport branch push failed"
56+
exit 1
57+
fi
58+
59+
- name: Create pull request
60+
id: create-pr
61+
if: steps.cherry-pick.outcome == 'success'
62+
uses: actions/github-script@v8
63+
with:
64+
github-token: '${{ secrets.PAT_TOKEN_READ_WRITE_PR }}'
65+
script: |
66+
const { data: pr } = await github.rest.pulls.create({
67+
owner: context.repo.owner,
68+
repo: context.repo.repo,
69+
title: `Backport 4.2: ${context.payload.pull_request.title}`,
70+
head: '${{ steps.cherry-pick.outputs.branch }}',
71+
base: '4.2',
72+
body: `Backport of #${context.payload.pull_request.number} to 4.2\n` +
73+
`Cherry-picked commit: ${context.payload.pull_request.merge_commit_sha}\n\n---\n` +
74+
`${context.payload.pull_request.body || ''}`
75+
});
76+
console.log(`Created backport PR: ${pr.html_url}`);
77+
await github.rest.issues.createComment({
78+
owner: context.repo.owner,
79+
repo: context.repo.repo,
80+
issue_number: context.payload.pull_request.number,
81+
body: `Backport PR for 4.2: #${pr.number}`
82+
});
83+
84+
- name: Report cherry-pick conflicts
85+
if: failure() && steps.cherry-pick.outcome != 'success'
86+
uses: actions/github-script@v8
87+
with:
88+
script: |
89+
await github.rest.issues.createComment({
90+
owner: context.repo.owner,
91+
repo: context.repo.repo,
92+
issue_number: context.payload.pull_request.number,
93+
body: `Could not create automatic backport PR.\nGot conflicts when cherry-picking onto 4.2.`
94+
});
95+
96+
- name: Report backport branch push failure
97+
if: failure() && steps.push.outcome != 'success'
98+
uses: actions/github-script@v8
99+
with:
100+
script: |
101+
await github.rest.issues.createComment({
102+
owner: context.repo.owner,
103+
repo: context.repo.repo,
104+
issue_number: context.payload.pull_request.number,
105+
body: `Could not create automatic backport PR.\n`+
106+
`I could cherry-pick onto 4.2 just fine, but pushing the new branch failed.`
107+
});
108+
109+
- name: Remove branch on PR create failure
110+
if: failure() && steps.create-pr.outcome != 'success'
111+
run: |
112+
git push -d origin "${{ steps.cherry-pick.outputs.branch }}"
Collapse file

‎.github/workflows/forwardport-50.yml‎

Copy file name to clipboard
+112Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Auto Forward port to 5.0
2+
on:
3+
pull_request_target:
4+
types:
5+
- closed
6+
- labeled
7+
branches:
8+
- '4.2'
9+
10+
jobs:
11+
backport:
12+
name: "Forward porting to 5.0"
13+
concurrency:
14+
group: port-50-${{ github.event.pull_request.number }}
15+
cancel-in-progress: true
16+
if: github.event.pull_request.merged && contains(github.event.pull_request.labels.*.name, 'needs-cherry-pick-5.0')
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v6
21+
with:
22+
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_PEM }}
23+
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
24+
fetch-depth: '0' # Cherry-pick needs full history
25+
26+
- name: Setup git configuration
27+
run: |
28+
git config --global user.email "[email protected]"
29+
git config --global user.name "Netty Project Bot"
30+
31+
- name: Create forward port PR branch and cherry-pick
32+
id: cherry-pick
33+
run: |
34+
MERGE_COMMIT="${{ github.event.pull_request.merge_commit_sha }}"
35+
echo "Forward porting commit: $MERGE_COMMIT"
36+
37+
FORWARDPORT_BRANCH="forwardport-pr-${{ github.event.pull_request.number }}-to-5.0"
38+
git fetch origin 5.0:5.0
39+
git checkout -b "$FORWARDPORT_BRANCH" 5.0
40+
41+
if git cherry-pick -x "$MERGE_COMMIT"; then
42+
echo "Cherry-pick successful"
43+
else
44+
echo "Cherry-pick failed - conflicts detected"
45+
git cherry-pick --abort
46+
exit 1
47+
fi
48+
echo "branch=$FORWARDPORT_BRANCH" >> "$GITHUB_OUTPUT"
49+
50+
- name: Push backport branch
51+
id: push
52+
if: steps.cherry-pick.outcome == 'success'
53+
run: |
54+
if ! git push origin "${{ steps.cherry-pick.outputs.branch }}"; then
55+
echo "Backport branch push failed"
56+
exit 1
57+
fi
58+
59+
- name: Create pull request
60+
id: create-pr
61+
if: steps.cherry-pick.outcome == 'success'
62+
uses: actions/github-script@v8
63+
with:
64+
github-token: '${{ secrets.PAT_TOKEN_READ_WRITE_PR }}'
65+
script: |
66+
const { data: pr } = await github.rest.pulls.create({
67+
owner: context.repo.owner,
68+
repo: context.repo.repo,
69+
title: `Forward port 5.0: ${context.payload.pull_request.title}`,
70+
head: '${{ steps.cherry-pick.outputs.branch }}',
71+
base: '5.0',
72+
body: `Forward port of #${context.payload.pull_request.number} to 5.0\n` +
73+
`Cherry-picked commit: ${context.payload.pull_request.merge_commit_sha}\n\n---\n` +
74+
`${context.payload.pull_request.body || ''}`
75+
});
76+
console.log(`Created forward port PR: ${pr.html_url}`);
77+
await github.rest.issues.createComment({
78+
owner: context.repo.owner,
79+
repo: context.repo.repo,
80+
issue_number: context.payload.pull_request.number,
81+
body: `Forward port PR for 5.0: #${pr.number}`
82+
});
83+
84+
- name: Report cherry-pick conflicts
85+
if: failure() && steps.cherry-pick.outcome != 'success'
86+
uses: actions/github-script@v8
87+
with:
88+
script: |
89+
await github.rest.issues.createComment({
90+
owner: context.repo.owner,
91+
repo: context.repo.repo,
92+
issue_number: context.payload.pull_request.number,
93+
body: `Could not create automatic backport PR.\nGot conflicts when cherry-picking onto 5.0.`
94+
});
95+
96+
- name: Report backport branch push failure
97+
if: failure() && steps.push.outcome != 'success'
98+
uses: actions/github-script@v8
99+
with:
100+
script: |
101+
await github.rest.issues.createComment({
102+
owner: context.repo.owner,
103+
repo: context.repo.repo,
104+
issue_number: context.payload.pull_request.number,
105+
body: `Could not create automatic backport PR.\n`+
106+
`I could cherry-pick onto 5.0 just fine, but pushing the new branch failed.`
107+
});
108+
109+
- name: Remove branch on PR create failure
110+
if: failure() && steps.create-pr.outcome != 'success'
111+
run: |
112+
git push -d origin "${{ steps.cherry-pick.outputs.branch }}"

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.