You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #1982 from gitgitgadget/add-the-action
This PR is part 3 of addressing #609, and it is stacked on top of #1980 and #1981 (and therefore contains also the commits of those PRs), therefore I will leave this in draft mode until those PRs are merged.
The grand idea is to bundle the `CIHelper` class together with all its direct and transitive dependencies into one big, honking `dist/index.js`, and then add a set of really minimal GitHub Actions that call into `CIHelper`. The Actions are added in sub-directories so that they can be called in GitHub workflows via e.g. `- uses: gitgitgadget/gitgitgadget/update-prs@1`.
The component used for bundling `CIHelper` is [`@vercel/ncc` ](https://www.npmjs.com/package/@vercel/ncc). To support acting as a GitHub Action, [`@actions/core`](https://www.npmjs.com/package/@actions/core) is installed.
To allow for really minimal GitHub Actions, the `CIHelper` class is augmented accordingly to re-implement more logic that is currently either in `misc-helper.ts` or in the (non-public 😞) Azure Pipelines definitions.
The naming convention for specifying the necessary tokens as GitHub Actions inputs is:
- `upstream-repo-token`: This is to comment on PRs in `git/git`
- `pr-repo-token`: This is to comment on PRs in `gitgitgadget/git` (as well as to be able to push to that repository)
- `test-repo-token`: This is to comment on PRs in `dscho/git` (used exclusively for testing)
To clarify, here is a diagram:
```mermaid
graph TD
user["user (contributor)"]
upstream-repo["upstream-repo (authoritative project repo)"]
pr-repo["pr-repo (GitGitGadget-enabled GitHub repo)"]
GitGitGadget["GitGitGadget"]
mailing-list["mailing-list"]
user -->|"opens PR"| pr-repo
user -->|"opens PR (if GitHub App installed)"| upstream-repo
upstream-repo -->|"GitGitGadget syncs branches to"| pr-repo
pr-repo -->|"slash commands"| GitGitGadget
upstream-repo -->|"slash commands (if App installed)"| GitGitGadget
GitGitGadget -->|"sends patch series"| mailing-list
```
0 commit comments