Skip to content

Start turning GitGitGadget into a set of GitHub Actions and workflows #1392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 40 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e6e3cd3
git-notes.test: avoid network calls
dscho Dec 16, 2024
30be28d
ci-helper.test: avoid network call
dscho Dec 16, 2024
33ab15f
Move the `getExternalConfig()` function to a better home
dscho Aug 19, 2023
b74f759
Merge branch 'no-network-calls'
dscho Aug 15, 2025
0cda7a4
CIHelper: make the `config` an explicit constructor parameter
dscho Aug 19, 2023
44e8d51
CIHelper: make even the `workDir` an optional parameter
dscho Aug 16, 2025
39729f4
GitGitGadget: be intentional about the push URL in addition to the token
dscho Aug 16, 2025
21a4026
CIHelper: allow specifying the information to send emails
dscho Aug 16, 2025
4a8d5c7
Merge branch 'prepare-config-handling'
dscho Aug 15, 2025
55ea650
Only demand that SMTP is configured when it is actually needed
dscho Aug 16, 2025
2188aba
Restart the effort to turn GitGitGadget's core logic into a GitHub Ac…
dscho Feb 8, 2025
cfb828b
Merge branch 'prepare-config-handling'
dscho Aug 15, 2025
c48de1f
CIHelper: add a convenient function to initialize e.g. the Git worktree
dscho Aug 15, 2025
b8ecec6
CIHelper.setupGitHubAction(): also process the SMTP inputs, if any
dscho Aug 16, 2025
c4d3c30
CIHelper.setupGitHubAction: configure Git committer information
dscho Aug 16, 2025
6ea8107
TODO: IHelper.setupGitHubAction: address the needs of GitGitGadget's …
dscho Aug 16, 2025
0ce0ae0
CIHelper: offer a convenient method to parse a PR comment URL
dscho Aug 16, 2025
95110b8
Install @actions/core
dscho Aug 14, 2025
7282d57
CIHelper: add a helper function to support the upcoming GitHub Action
dscho Aug 20, 2023
b12a397
Install `@vercel/ncc`
dscho Aug 19, 2023
f0f4e57
Run `ncc` via `npm run build-dist`
dscho Mar 4, 2025
526a56a
TO-DROP: vscode: add a debug configuration for the `init` Action
dscho Aug 14, 2025
015b3be
Ensure that `res/WELCOME.md` is found even after compiling with `ncc`
dscho Feb 8, 2025
fb1ad6f
DEBUG the `handle-pr-comment` Action locally
dscho Aug 16, 2025
f390ccf
eslint: in the upcoming JavaScript code, skip unneeded semicolons
dscho Aug 15, 2025
8c72a39
Add the `gitgitgadget/init` GitHub Action
dscho Aug 19, 2023
f1f4bb6
eslint.config: adjust to new ESLint preferences
dscho Aug 16, 2025
313a038
TEST: add a reaction
dscho Aug 20, 2023
014a2be
Add the `handle-pr-comment` GitHub Action
dscho Aug 16, 2025
3e188c0
DEBUG: optionally avoid all actions
dscho Aug 16, 2025
2568621
Merge branch 'add-the-action'
dscho Aug 15, 2025
9c3d346
TO-DROP: add dist/index.js, for testing
dscho Aug 19, 2023
ad71d72
TO-DROP: test the GitHub Action
dscho Aug 19, 2023
effd657
TO-DROP: disable all CI builds except `test-action`
dscho Aug 16, 2025
fd767e0
DEBUGGING: add a `git()` proxy method to `CIHelper`
dscho Aug 16, 2025
6b9fd1d
TEST: proxy `isAllowed()` from CIHelper to GitGitGadget
dscho Aug 16, 2025
d79db71
TEST: verify that GitGitGadget's options were fetched
dscho Aug 16, 2025
36de3c4
DEBUG: more logging
dscho Aug 16, 2025
57f11f4
npm ci && npm run build && npm run build-dist
dscho Aug 16, 2025
1e5c77f
Merge branch 'test-action'
dscho Aug 15, 2025
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
22 changes: 0 additions & 22 deletions .github/workflows/auto-approve-dependabot-prs.yml

This file was deleted.

132 changes: 0 additions & 132 deletions .github/workflows/build-and-test.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test the GitHub Action

on:
push:

jobs:
test-action:
runs-on: ubuntu-latest

steps:
- uses: actions/create-github-app-token@v1
id: gitgitgadget-git-token
with:
app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }}
owner: gitgitgadget
repositories: git
- uses: actions/create-github-app-token@v1
id: git-git-token
with:
app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }}
owner: git
repositories: git
- uses: actions/create-github-app-token@v1
id: dscho-git-token
with:
app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }}
owner: dscho
repositories: git
- uses: actions/checkout@v5
- uses: ./handle-pr-comment
with:
gitgitgadget-git-access-token: ${{ steps.gitgitgadget-git-token.outputs.token }}
git-git-access-token: ${{ steps.git-git-token.outputs.token }}
dscho-git-access-token: ${{ steps.dscho-git-token.outputs.token }}
smtp-options: '{"user": "[email protected]", "host": "smtp.gmail.com", "pass": ${{ toJSON(secrets.GITGITGADGET_SMTP_PASS) }}}'
pr-comment-url: https://github.com/gitgitgadget/git/pull/1947#issuecomment-3193794374
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/.env
/.test-dir/
/build/
/dist/**/*.d.ts
/node_modules/
/npm-debug.log
/junit.xml
Expand All @@ -10,4 +11,3 @@
/obj/**
/*.sln*
/*.njsproj*
/*.tgz
27 changes: 26 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch `handle-pr-comment`",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
// "--nolazy",
],
"args": [
"${workspaceFolder}/handle-pr-comment/index.js"
],
"stopOnEntry": false,
"cwd": "${workspaceFolder}",
"runtimeExecutable": null,
"env": {
"NODE_ENV": "development",
"GITGITGADGET_DEBUG": "1",
},
"console": "integratedTerminal",
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/build/**/*.js",
"${workspaceFolder}/dist/**/*.js",
"${workspaceFolder}/lib/**/*.js"
]
},
{
"name": "Tests",
"type": "node",
Expand All @@ -18,7 +44,6 @@
],
"stopOnEntry": false,
"cwd": "${workspaceFolder}",
"preLaunchTask": null,
"runtimeExecutable": null,
"env": {
"NODE_ENV": "development"
Expand Down
1 change: 1 addition & 0 deletions dist/293248747edf5d37944a.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = eval("require")(".");
5 changes: 5 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
69 changes: 69 additions & 0 deletions dist/res/WELCOME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Welcome to [GitGitGadget](https://gitgitgadget.github.io/)

Hi @${username}, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests.

Please make sure that either:

- Your Pull Request has a good description, if it consists of multiple commits, as it will be used as cover letter.
- Your Pull Request description is empty, if it consists of a single commit, as the commit message should be descriptive enough by itself.

You can CC potential reviewers by adding a footer to the PR description with the following syntax:

CC: Revi Ewer <[email protected]>, Ill Takalook <[email protected]>

NOTE: DO NOT copy/paste your CC list from a previous GGG PR's description,
because it will result in a malformed CC list on the mailing list. See
[example](https://lore.kernel.org/git/[email protected]/).

Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:

* the lines should not exceed 76 columns,
* the first line should be like a header and typically start with a prefix like "tests:" or "revisions:" to state which subsystem the change is about, and
* the commit messages' body should be [describing the "why?" of the change](https://git-scm.com/docs/SubmittingPatches#describe-changes).
* Finally, the commit messages should end in a [Signed-off-by:](https://git-scm.com/docs/SubmittingPatches#dco) line matching the commits' author.

It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code.

## Contributing the patches

Before you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a comment to your PR of the form `/allow`. A good way to find other contributors is to locate recent pull requests where someone has been `/allow`ed:

* [Search: is:pr is:open "/allow"](https://github.com/gitgitgadget/git/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+%22%2Fallow%22)

Both the person who commented `/allow` and the PR author are able to `/allow` you.

An alternative is the channel [`#git-devel`](https://web.libera.chat/#git-devel) on the Libera Chat IRC network:

<newcontributor> I've just created my first PR, could someone please /allow me? https://github.com/gitgitgadget/git/pull/12345
<veteran> newcontributor: it is done
<newcontributor> thanks!

Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment `/submit`.

If you want to see what email(s) would be sent for a `/submit` request, add a PR comment `/preview` to have the email(s) sent to you. You must have a public GitHub email address for this. Note that any reviewers CC'd via the list in the PR description will *not* actually be sent emails.

After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions (while the comments and suggestions will be mirrored into the PR by GitGitGadget, you will still want to [reply via mail](https://gitgitgadget.github.io/reply-to-this)).

If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox from the [Git mailing list archive](https://lore.kernel.org/git) (click the `(raw)` link), then import it into your mail program. If you use GMail, you can do this via:

```sh
curl -g --user "<EMailAddress>:<Password>" \
--url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt
```

To iterate on your change, i.e. send a revised patch or patch series, you will first want to (force-)push to the same branch. You probably also want to modify your Pull Request description (or title). It is a good idea to summarize the revision by adding something like this to the cover letter (read: by editing the first comment on the PR, i.e. the PR description):

```
Changes since v1:
- Fixed a typo in the commit message (found by ...)
- Added a code comment to ... as suggested by ...
...
```

To send a new iteration, just add another PR comment with the contents: `/submit`.

## Need help?

New contributors who want advice are encouraged to join [[email protected]](https://groups.google.com/forum/#!forum/git-mentoring), where volunteers who regularly contribute to Git are willing to answer newbie questions, give advice, or otherwise provide mentoring to interested contributors. You must join in order to post or view messages, but anyone can join.

You may also be able to find help in real time in the developer IRC channel, [`#git-devel`](https://web.libera.chat/#git-devel) on Libera Chat. Remember that IRC does not support offline messaging, so if you send someone a private message and log out, they cannot respond to you. The scrollback of `#git-devel` is [archived](https://colabti.org/irclogger//irclogger_logs/git-devel), though.
1 change: 1 addition & 0 deletions dist/sourcemap-register.cjs

Large diffs are not rendered by default.

30 changes: 21 additions & 9 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import eslint from "@eslint/js";
import stylistic from "@stylistic/eslint-plugin";
import jsdoc from "eslint-plugin-jsdoc";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintPluginPrettier from "eslint-plugin-prettier";
import eslintPluginSecurity from "eslint-plugin-security";
import globals from "globals";
import tseslint from "typescript-eslint";
import eslint from "@eslint/js"
import stylistic from "@stylistic/eslint-plugin"
import jsdoc from "eslint-plugin-jsdoc"
import eslintConfigPrettier from "eslint-config-prettier"
import eslintPluginPrettier from "eslint-plugin-prettier"
import eslintPluginSecurity from "eslint-plugin-security"
import globals from "globals"
import tseslint from "typescript-eslint"

export default tseslint.config(
{
Expand Down Expand Up @@ -127,6 +127,18 @@ export default tseslint.config(
"security/detect-object-injection": "off",
},
},
{
files: ["**/*.js", "**/*.mjs"],
rules: {
"@stylistic/semi": ["error", "never"],
"prettier/prettier": [
"warn",
{
semi: false,
},
],
},
},
{
files: ["tests/*.ts", "lib/*.ts", "script/*.ts"],
extends: [...tseslint.configs.recommendedTypeChecked],
Expand Down Expand Up @@ -181,4 +193,4 @@ export default tseslint.config(
},
},
// eslintPluginPrettierRecommended,
);
)
25 changes: 25 additions & 0 deletions handle-pr-comment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Handle PR Comment'
description: 'Handles slash commands such as /submit and /preview'
author: 'Johannes Schindelin'
inputs:
gitgitgadget-git-access-token:
description: 'The access token to work on gitgitgadget/git'
required: true
git-git-access-token:
description: 'The access token to work on git/git'
required: true
dscho-git-access-token:
description: 'The access token to work on dscho/git'
required: true
smtp-options:
description: 'The SMTP options to use for sending emails'
required: true
pr-comment-url:
description: 'The URL of the PR comment to add a reaction to'
required: true
runs:
using: 'node20'
main: './index.js'
branding:
icon: 'git-commit'
color: 'orange'
Loading