Skip to content

Commit 40f0d48

Browse files
committed
Add the update-prs GitHub Action
The idea is to take over the job of the "Update GitGitGadget's PRs" Azure Pipeline over at https://dev.azure.com/gitgitgadget/git/_build?definitionId=2. This will obviously require a GitHub workflow, which is added in gitgitgadget-workflows/gitgitgadget-workflows#1 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 0339122 commit 40f0d48

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

update-prs/action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Update the Pull Requests'
2+
description: 'Updates the Pull Requests in response to upstream commits'
3+
author: 'Johannes Schindelin'
4+
inputs:
5+
pr-repo-token:
6+
description: 'The access token to work on the repository that holds PRs and state'
7+
required: true
8+
upstream-repo-token:
9+
description: 'The access token to work on PRs in the upstream repository'
10+
required: true
11+
test-repo-token:
12+
description: 'The access token to work on PRs in the test repository'
13+
required: true
14+
runs:
15+
using: 'node20'
16+
main: './index.js'
17+
branding:
18+
icon: 'git-commit'
19+
color: 'orange'

update-prs/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
async function run() {
2+
const { CIHelper } = await import("../dist/index.js")
3+
4+
const ci = new CIHelper()
5+
6+
await ci.setupGitHubAction({
7+
needsUpstreamBranches: true,
8+
})
9+
await ci.updateOpenPrs()
10+
await ci.updateCommitMappings()
11+
await ci.handleOpenPRs()
12+
}
13+
14+
run()

0 commit comments

Comments
 (0)