Add two sources to support use as actions#1055
Add two sources to support use as actions#1055dscho merged 1 commit intogitgitgadget:maingitgitgadget/gitgitgadget:mainfrom
Conversation
`pull-action` is used for pull request related events (create, synchronize, comment). `misc-action` is used for other scheduled events such as checking mailing list emails. Add *.tgz to .gitignore for untracked package. Signed-off-by: Chris. Webster <chris@webstech.net>
|
Sample repo with two actions using the new functions. These could (should) be part of gitgitgadget. The doc suggests all actions should be in separate repos but it is not mandatory. Since these could be used by external projects using gitgitgadget, should they be in separate projects? |
dscho
left a comment
There was a problem hiding this comment.
Thank you so much for pushing this along!
|
Since such a lot of code is shared, I would think that it makes sense to keep things in a single repository. I would be in favor of refactoring so that it is a single Action running in different modes. Eventually, I want to use |
The actions in the sample have a duplicated (location suggested in GitHub docs for multi-action repo).
The pull request action has different inputs so it should have its own
The sample is doing this. The outputs are in the same folders as the |
I agree, this would be ugly. But maybe we can use the shorter names
Now I understand. And I agree with your reasoning. Thank you for being patient with me.
I totally missed this (I was on my phone, I did not work last week). It looks beautiful. |
…tion In preparation for a different approach, remove what had been done in 5e0129b (Merge pull request #1055 from webstech/action, 2022-07-20) I would like to go into a different direction: - move pretty much all the core logic from `misc-helper` to `CIHelper`. - use `ncc` to bundle `CIHelper` as a single `dist/index.js` file. - add dedicates GitHub Actions in subdirectories that contain really small `index.js` files which in turn import the `CIHelper` and then let it do its magic. As a consequence, the Azure Pipelines we currently use can then be migrated to GitHub workflows in gitgitgadget/gitgitgadget-workflows and use the Actions like this: - uses: gitgitgadget/gitgitgadget/handle-slash-command@v1 with: repository: gitgitgadget/git pr-number: ... issue-comment-id: ... gitgitgadget-app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }} gitgitgadget-private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }} gitgitgadget-git-app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }} gitgitgadget-git-private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }} Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…tion In preparation for a different approach, remove what had been done in 5e0129b (Merge pull request #1055 from webstech/action, 2022-07-20) I would like to go into a different direction: - move pretty much all the core logic from `misc-helper` to `CIHelper`. - use `ncc` to bundle `CIHelper` as a single `dist/index.js` file. - add dedicates GitHub Actions in subdirectories that contain really small `index.js` files which in turn import the `CIHelper` and then let it do its magic. As a consequence, the Azure Pipelines we currently use can then be migrated to GitHub workflows in gitgitgadget/gitgitgadget-workflows and use the Actions like this: - uses: gitgitgadget/gitgitgadget/handle-slash-command@v1 with: repository: gitgitgadget/git pr-number: ... issue-comment-id: ... gitgitgadget-app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }} gitgitgadget-private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }} gitgitgadget-git-app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }} gitgitgadget-git-private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }} Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…tion In preparation for a different approach, remove what had been done in 5e0129b (Merge pull request #1055 from webstech/action, 2022-07-20) I would like to go into a different direction: - move pretty much all the core logic from `misc-helper` to `CIHelper`. - use `ncc` to bundle `CIHelper` as a single `dist/index.js` file. - add dedicates GitHub Actions in subdirectories that contain really small `index.js` files which in turn import the `CIHelper` and then let it do its magic. As a consequence, the Azure Pipelines we currently use can then be migrated to GitHub workflows in gitgitgadget/gitgitgadget-workflows and use the Actions like this: - uses: gitgitgadget/gitgitgadget/handle-slash-command@v1 with: repository: gitgitgadget/git pr-number: ... issue-comment-id: ... gitgitgadget-app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }} gitgitgadget-private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }} gitgitgadget-git-app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }} gitgitgadget-git-private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }} Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…tion In preparation for a different approach, remove what had been done in 5e0129b (Merge pull request #1055 from webstech/action, 2022-07-20) I would like to go into a different direction: - move pretty much all the core logic from `misc-helper` to `CIHelper`. - use `ncc` to bundle `CIHelper` as a single `dist/index.js` file. - add dedicates GitHub Actions in subdirectories that contain really small `index.js` files which in turn import the `CIHelper` and then let it do its magic. As a consequence, the Azure Pipelines we currently use can then be migrated to GitHub workflows in gitgitgadget/gitgitgadget-workflows and use the Actions like this: - uses: gitgitgadget/gitgitgadget/handle-slash-command@v1 with: repository: gitgitgadget/git pr-number: ... issue-comment-id: ... gitgitgadget-app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }} gitgitgadget-private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }} gitgitgadget-git-app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }} gitgitgadget-git-private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }} Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…tion In preparation for a different approach, remove what had been done in 5e0129b (Merge pull request #1055 from webstech/action, 2022-07-20) I would like to go into a different direction: - move pretty much all the core logic from `misc-helper` to `CIHelper`. - use `ncc` to bundle `CIHelper` as a single `dist/index.js` file. - add dedicates GitHub Actions in subdirectories that contain really small `index.js` files which in turn import the `CIHelper` and then let it do its magic. As a consequence, the Azure Pipelines we currently use can then be migrated to GitHub workflows in gitgitgadget/gitgitgadget-workflows and use the Actions like this: - uses: gitgitgadget/gitgitgadget/handle-slash-command@v1 with: repository: gitgitgadget/git pr-number: ... issue-comment-id: ... gitgitgadget-app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }} gitgitgadget-private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }} gitgitgadget-git-app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }} gitgitgadget-git-private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }} Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…tion In preparation for a different approach, remove what had been done in 5e0129b (Merge pull request gitgitgadget#1055 from webstech/action, 2022-07-20) I would like to go into a different direction: - move pretty much all the core logic from `misc-helper` to `CIHelper`. - use `ncc` to bundle `CIHelper` as a single `dist/index.js` file. - add dedicates GitHub Actions in subdirectories that contain really small `index.js` files which in turn import the `CIHelper` and then let it do its magic. As a consequence, the Azure Pipelines we currently use can then be migrated to GitHub workflows in gitgitgadget/gitgitgadget-workflows and use the Actions like this: - uses: gitgitgadget/gitgitgadget/handle-slash-command@v1 with: repository: gitgitgadget/git pr-number: ... issue-comment-id: ... gitgitgadget-app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }} gitgitgadget-private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }} gitgitgadget-git-app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }} gitgitgadget-git-private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }} Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…tion In preparation for a different approach, remove what had been done in 5e0129b (Merge pull request gitgitgadget#1055 from webstech/action, 2022-07-20) I would like to go into a different direction: - move pretty much all the core logic from `misc-helper` to `CIHelper`. - use `ncc` to bundle `CIHelper` as a single `dist/index.js` file. - add dedicates GitHub Actions in subdirectories that contain really small `index.js` files which in turn import the `CIHelper` and then let it do its magic. As a consequence, the Azure Pipelines we currently use can then be migrated to GitHub workflows in gitgitgadget/gitgitgadget-workflows and use the Actions like this: - uses: gitgitgadget/gitgitgadget/handle-slash-command@v1 with: repository: gitgitgadget/git pr-number: ... issue-comment-id: ... gitgitgadget-app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }} gitgitgadget-private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }} gitgitgadget-git-app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }} gitgitgadget-git-private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }} Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…tion In preparation for a different approach, remove what had been done in 5e0129b (Merge pull request gitgitgadget#1055 from webstech/action, 2022-07-20) I would like to go into a different direction: - move pretty much all the core logic from `misc-helper` to `CIHelper`. - use `ncc` to bundle `CIHelper` as a single `dist/index.js` file. - add dedicates GitHub Actions in subdirectories that contain really small `index.js` files which in turn import the `CIHelper` and then let it do its magic. As a consequence, the Azure Pipelines we currently use can then be migrated to GitHub workflows in gitgitgadget/gitgitgadget-workflows and use the Actions like this: - uses: gitgitgadget/gitgitgadget/handle-slash-command@v1 with: repository: gitgitgadget/git pr-number: ... issue-comment-id: ... gitgitgadget-app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }} gitgitgadget-private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }} gitgitgadget-git-app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }} gitgitgadget-git-private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }} Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…tion In preparation for a different approach, remove what had been done in 5e0129b (Merge pull request gitgitgadget#1055 from webstech/action, 2022-07-20) I would like to go into a different direction: - move pretty much all the core logic from `misc-helper` to `CIHelper`. - use `ncc` to bundle `CIHelper` as a single `dist/index.js` file. - add dedicates GitHub Actions in subdirectories that contain really small `index.js` files which in turn import the `CIHelper` and then let it do its magic. As a consequence, the Azure Pipelines we currently use can then be migrated to GitHub workflows in gitgitgadget/gitgitgadget-workflows and use the Actions like this: - uses: gitgitgadget/gitgitgadget/handle-slash-command@v1 with: repository: gitgitgadget/git pr-number: ... issue-comment-id: ... gitgitgadget-app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }} gitgitgadget-private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }} gitgitgadget-git-app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }} gitgitgadget-git-private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }} Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…tion In preparation for a different approach, remove what had been done in 5e0129b (Merge pull request #1055 from webstech/action, 2022-07-20) I would like to go into a different direction: - move pretty much all the core logic from `misc-helper` to `CIHelper`. - use `ncc` to bundle `CIHelper` as a single `dist/index.js` file. - add dedicates GitHub Actions in subdirectories that contain really small `index.js` files which in turn import the `CIHelper` and then let it do its magic. As a consequence, the Azure Pipelines we currently use can then be migrated to GitHub workflows in gitgitgadget/gitgitgadget-workflows and use the Actions like this: - uses: gitgitgadget/gitgitgadget/handle-slash-command@v1 with: repository: gitgitgadget/git pr-number: ... issue-comment-id: ... gitgitgadget-app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }} gitgitgadget-private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }} gitgitgadget-git-app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }} gitgitgadget-git-private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }} Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
A couple of thin layers to allow gitgitgadget functions to be accessed from GitHub actions. The actions are similar to misc-helper but more specialized. Currently, nothing is published as a package. Action providers must run
npm packon gitgitgadget and specify the package on thenpm installcommand in the action repo.pull-actionis used for pull request related events (create, synchronize, comment).misc-actionis used for other scheduled events such as checking mailing list emails.Add *.tgz to .gitignore for untracked package.