pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/gitgitgadget/gitgitgadget/pull/2029/files

el="stylesheet" href="https://github.githubassets.com/assets/code-2d31826944fd3be8.css" /> Add an Action to create/update Check Runs conveniently by dscho · Pull Request #2029 · gitgitgadget/gitgitgadget · GitHub
Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/push-github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
# Now, add the generated files
git add -A dist/ &&
# Remove the rest
git rm -r -- \* ':(exclude)dist/' ':(exclude)*/action.yml' ':(exclude)*/index.js' &&
git rm -r -- \* ':(exclude)dist/' ':(exclude)*/action.yml' ':(exclude)*/index.js' ':(exclude)*/post.js' &&

# Now make that fake merge commit
tree=$(git write-tree) &&
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"tbdiff",
"Thái",
"Truthy",
"typia",
"unportable",
"vger",
"VSTS",
Expand Down
53 changes: 53 additions & 0 deletions check-run/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'Create or update a Check Run'
description: 'Mirrors a workflow run to a Check Run of a Pull Request in a different repository'
author: 'Johannes Schindelin'
inputs:
config:
description: 'The GitGitGadget configuration to use (see https://github.com/gitgitgadget/gitgitgadget/blob/HEAD/lib/project-config.ts)'
default: '' # sadly, ${{ vars.CONFIG }} does not work, and documentation about what contexts are permissible here is sorely missing
pr-repo-token:
description: 'The access token to work on the repository that holds PRs and state'
required: true
upstream-repo-token:
description: 'The access token to work on PRs in the upstream repository'
required: false
test-repo-token:
description: 'The access token to work on PRs in the test repository'
required: false
pr-url:
description: 'The URL of the Pull Request (or Pull Request comment)'
required: false
check-run-id:
description: 'The Check Run to update (if empty, a new one will be created)'
default: ''
name:
description: 'The name of the CheckRun (required if check-run-id is empty)'
default: ''
title:
description: 'The Check Run title (required when creating a new one)'
default: ''
summary:
description: 'The Check Run summary (required when creating a new one)'
default: ''
text:
description: 'The Check Run text (required when creating a new one)'
default: ''
details-url:
description: 'The details URL of the Check Run (required when creating a new one)'
default: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
conclusion:
description: 'If set, the Check Run will be marked as completed'
default: ''
job-status:
description: 'Needed at the end of the job'
default: ${{ job.status }}
outputs:
check-run-id:
description: 'The ID of the created or updated Check Run'
runs:
using: 'node20'
main: './index.js'
post: './post.js'
branding:
icon: 'git-commit'
color: 'orange'
13 changes: 13 additions & 0 deletions check-run/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
async function run() {
const { CIHelper } = await import("../dist/index.js")

try {
const ci = new CIHelper()
ci.setupGitHubAction({ createOrUpdateCheckRun: true })
} catch (e) {
console.error(e)
process.exitCode = 1
}
}

run()
13 changes: 13 additions & 0 deletions check-run/post.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
async function run() {
const { CIHelper } = await import("../dist/index.js")

try {
const ci = new CIHelper()
ci.setupGitHubAction({ createOrUpdateCheckRun: "post" })
} catch (e) {
console.error(e)
process.exitCode = 1
}
}

run()
3 changes: 3 additions & 0 deletions handle-new-mails/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: 'Handle new mails'
description: 'Processes new mails on the Git mailing list'
author: 'Johannes Schindelin'
inputs:
config:
description: 'The GitGitGadget configuration to use (see https://github.com/gitgitgadget/gitgitgadget/blob/HEAD/lib/project-config.ts)'
default: '' # sadly, ${{ vars.CONFIG }} does not work, and documentation about what contexts are permissible here is sorely missing
pr-repo-token:
description: 'The access token to work on the repository that holds PRs and state'
required: true
Expand Down
3 changes: 3 additions & 0 deletions handle-pr-comment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: 'Handle PR Comment'
description: 'Handles slash commands such as /submit and /preview'
author: 'Johannes Schindelin'
inputs:
config:
description: 'The GitGitGadget configuration to use (see https://github.com/gitgitgadget/gitgitgadget/blob/HEAD/lib/project-config.ts)'
default: '' # sadly, ${{ vars.CONFIG }} does not work, and documentation about what contexts are permissible here is sorely missing
pr-repo-token:
description: 'The access token to work on the repository that holds PRs and state'
required: true
Expand Down
4 changes: 2 additions & 2 deletions handle-pr-comment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ async function run() {
const { CIHelper } = await import("../dist/index.js")

const ci = new CIHelper()
const { owner, commentId } = ci.parsePRCommentURLInput()
const { owner, comment_id } = ci.parsePRCommentURLInput()

await ci.setupGitHubAction()
await ci.handleComment(owner, commentId)
await ci.handleComment(owner, comment_id)
}

run()
3 changes: 3 additions & 0 deletions handle-pr-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: 'Handle PR Pushes'
description: 'Handles when a PR was pushed'
author: 'Johannes Schindelin'
inputs:
config:
description: 'The GitGitGadget configuration to use (see https://github.com/gitgitgadget/gitgitgadget/blob/HEAD/lib/project-config.ts)'
default: '' # sadly, ${{ vars.CONFIG }} does not work, and documentation about what contexts are permissible here is sorely missing
pr-repo-token:
description: 'The access token to work on the repository that holds PRs and state'
required: true
Expand Down
4 changes: 2 additions & 2 deletions handle-pr-push/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ async function run() {
const { CIHelper } = await import("../dist/index.js")

const ci = new CIHelper()
const { owner, prNumber } = ci.parsePRURLInput()
const { owner, pull_number } = ci.parsePRURLInput()

await ci.setupGitHubAction()
await ci.handlePush(owner, prNumber)
await ci.handlePush(owner, pull_number)
}

run()
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy