Skip to content

Commit 7979f53

Browse files
committed
Add the handle-pr-push GitHub Action
This GitHub Action is designed to implement the functionality that is currently handled when pushing to PRs by these Azure Pipelines: - GitGitGadget PR Handler: https://dev.azure.com/gitgitgadget/git/_build?definitionId=3 - GitGitGadget PR Handler (git): https://dev.azure.com/gitgitgadget/git/_build?definitionId=13 - GitGitGadget PR Handler (dscho): https://dev.azure.com/gitgitgadget/git/_build?definitionId=12 This Action will be used in a GitHub workflow that will replace those trusty Azure Pipelines we used for so long. This workflow lives in a different org, for full details see gitgitgadget-workflows/gitgitgadget-workflows#1. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 3a84ca1 commit 7979f53

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

handle-pr-push/action.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'Handle PR Pushes'
2+
description: 'Handles when a PR was pushed'
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+
pr-url:
15+
description: 'The URL of the PR that was pushed'
16+
required: true
17+
runs:
18+
using: 'node20'
19+
main: './index.js'
20+
branding:
21+
icon: 'git-commit'
22+
color: 'orange'

handle-pr-push/index.js

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

0 commit comments

Comments
 (0)