@dougefresh/ci 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.checkov.yml +7 -0
- package/.env.example +61 -0
- package/.gitattributes +3 -0
- package/.github/actions/install-yq/action.yaml +80 -0
- package/.github/actions/install-yq/scripts/unixish.sh +112 -0
- package/.github/actions/install-yq/scripts/windowsish.ps1 +99 -0
- package/.github/actions/rust-config/action.yml +34 -0
- package/.github/actions/rust-init/action.yml +75 -0
- package/.github/ci-configs/dummy.yml +24 -0
- package/.github/ci-configs/rust/ai.yml +65 -0
- package/.github/ci-configs/rust-default.yml +115 -0
- package/.github/ci-configs/test/01.yml +9 -0
- package/.github/copilot-instructions.md +118 -0
- package/.github/dependabot.yml +26 -0
- package/.github/prompts/create-release-notes.prompt.md +29 -0
- package/.github/prompts/unit-test.prompt.md +77 -0
- package/.github/rust-ci.ts +5 -0
- package/.github/workflows/action-ci.yml +39 -0
- package/.github/workflows/action-review.yml +14 -0
- package/.github/workflows/dummy-release.yml +32 -0
- package/.github/workflows/dummy-test.yml +16 -0
- package/.github/workflows/pages.yml +59 -0
- package/.github/workflows/pr-review.yml +93 -0
- package/.github/workflows/release.yml +41 -0
- package/.github/workflows/rust-release.yml +133 -0
- package/.github/workflows/rust.yml +247 -0
- package/.node-version +1 -0
- package/AGENTS.md +13 -0
- package/Cargo.toml +6 -0
- package/LICENSE +21 -0
- package/README.md +58 -0
- package/action.yml +32 -0
- package/biome.jsonc +108 -0
- package/bun.lock +22 -0
- package/dist/ai.d.ts +11 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +52 -0
- package/dist/ai.js.map +1 -0
- package/dist/index.d.ts +106 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +212 -0
- package/dist/index.js.map +1 -0
- package/docs/SUMMARY.md +3 -0
- package/docs/book.toml +49 -0
- package/docs/index.md +32 -0
- package/package.json +30 -0
- package/pre-commit +2 -0
- package/scripts/bump-version.ts +16 -0
- package/scripts/generate-rust.ts +9 -0
- package/src/ai.ts +61 -0
- package/src/index.ts +287 -0
- package/src/lib.rs +8 -0
- package/src/main.rs +11 -0
- package/tsconfig.json +25 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Copilot Instructions
|
|
2
|
+
|
|
3
|
+
This GitHub Action is written in TypeScript and transpiled to JavaScript. Both the TypeScript sources and the
|
|
4
|
+
**generated** JavaScript code are contained in this repository. The TypeScript sources are contained in the `src`
|
|
5
|
+
directory and the JavaScript code is contained in the `dist` directory. A GitHub Actions workflow checks that the
|
|
6
|
+
JavaScript code in `dist` is up-to-date. Therefore, you should not review any changes to the contents of the `dist`
|
|
7
|
+
folder and it is expected that the JavaScript code in `dist` closely mirrors the TypeScript code it is generated from.
|
|
8
|
+
|
|
9
|
+
## Repository Structure
|
|
10
|
+
|
|
11
|
+
| Path | Description |
|
|
12
|
+
| -------------------- | -------------------------------------------------------- |
|
|
13
|
+
| `__fixtures__/` | Unit Test Fixtures |
|
|
14
|
+
| `__tests__/` | Unit Tests |
|
|
15
|
+
| `.devcontainer/` | Development Container Configuration |
|
|
16
|
+
| `.github/` | GitHub Configuration |
|
|
17
|
+
| `.licenses/` | License Information |
|
|
18
|
+
| `.vscode/` | Visual Studio Code Configuration |
|
|
19
|
+
| `badges/` | Badges for readme |
|
|
20
|
+
| `dist/` | Generated JavaScript Code |
|
|
21
|
+
| `src/` | TypeScript Source Code |
|
|
22
|
+
| `.env.example` | Environment Variables Example for `@github/local-action` |
|
|
23
|
+
| `.licensed.yml` | Licensed Configuration |
|
|
24
|
+
| `.markdown-lint.yml` | Markdown Linter Configuration |
|
|
25
|
+
| `.node-version` | Node.js Version Configuration |
|
|
26
|
+
| `.prettierrc.yml` | Prettier Formatter Configuration |
|
|
27
|
+
| `.yaml-lint.yml` | YAML Linter Configuration |
|
|
28
|
+
| `action.yml` | GitHub Action Metadata |
|
|
29
|
+
| `CODEOWNERS` | Code Owners File |
|
|
30
|
+
| `eslint.config.mjs` | ESLint Configuration |
|
|
31
|
+
| `jest.config.js` | Jest Configuration |
|
|
32
|
+
| `LICENSE` | License File |
|
|
33
|
+
| `package.json` | NPM Package Configuration |
|
|
34
|
+
| `README.md` | Project Documentation |
|
|
35
|
+
| `rollup.config.ts` | Rollup Bundler Configuration |
|
|
36
|
+
| `tsconfig.json` | TypeScript Configuration |
|
|
37
|
+
|
|
38
|
+
## Environment Setup
|
|
39
|
+
|
|
40
|
+
Install dependencies by running:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Testing
|
|
47
|
+
|
|
48
|
+
Ensure all unit tests pass by running:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm run test
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Unit tests should exist in the `__tests__` directory. They are powered by `jest`. Fixtures should be placed in the
|
|
55
|
+
`__fixtures__` directory.
|
|
56
|
+
|
|
57
|
+
## Bundling
|
|
58
|
+
|
|
59
|
+
Any time files in the `src` directory are changed, you should run the following command to bundle the TypeScript code
|
|
60
|
+
into JavaScript:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm run bundle
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## General Coding Guidelines
|
|
67
|
+
|
|
68
|
+
- Follow standard TypeScript and JavaScript coding conventions and best practices
|
|
69
|
+
- Changes should maintain consistency with existing patterns and style
|
|
70
|
+
- Document changes clearly and thoroughly, including updates to existing comments when appropriate
|
|
71
|
+
- Do not include basic, unnecessary comments that simply restate what the code is doing (focus on explaining _why_, not
|
|
72
|
+
_what_)
|
|
73
|
+
- Use consistent error handling patterns throughout the codebase
|
|
74
|
+
- Use TypeScript's type system to ensure type safety and clarity
|
|
75
|
+
- Keep functions focused and manageable
|
|
76
|
+
- Use descriptive variable and function names that clearly convey their purpose
|
|
77
|
+
- Use JSDoc comments to document functions, classes, and complex logic
|
|
78
|
+
- After doing any refactoring, ensure to run `npm run test` to ensure that all tests still pass and coverage
|
|
79
|
+
requirements are met
|
|
80
|
+
- When suggesting code changes, always opt for the most maintainable approach. Try your best to keep the code clean and
|
|
81
|
+
follow "Don't Repeat Yourself" (DRY) principles
|
|
82
|
+
- Avoid unnecessary complexity and always consider the long-term maintainability of the code
|
|
83
|
+
- When writing unit tests, try to consider edge cases as well as the main path of success. This will help ensure that
|
|
84
|
+
the code is robust and can handle unexpected inputs or situations
|
|
85
|
+
- Use the `@actions/core` package for logging over `console` to ensure compatibility with GitHub Actions logging
|
|
86
|
+
features
|
|
87
|
+
|
|
88
|
+
### Versioning
|
|
89
|
+
|
|
90
|
+
GitHub Actions are versioned using branch and tag names. Please ensure the version in the project's `package.json` is
|
|
91
|
+
updated to reflect the changes made in the codebase. The version should follow
|
|
92
|
+
[Semantic Versioning](https://semver.org/) principles.
|
|
93
|
+
|
|
94
|
+
## Pull Request Guidelines
|
|
95
|
+
|
|
96
|
+
When creating a pull request (PR), please ensure that:
|
|
97
|
+
|
|
98
|
+
- Keep changes focused and minimal (avoid large changes, or consider breaking them into separate, smaller PRs)
|
|
99
|
+
- Formatting checks pass
|
|
100
|
+
- Linting checks pass
|
|
101
|
+
- Unit tests pass and coverage requirements are met
|
|
102
|
+
- The action has been transpiled to JavaScript and the `dist` directory is up-to-date with the latest changes in the
|
|
103
|
+
`src` directory
|
|
104
|
+
- If necessary, the `README.md` file is updated to reflect any changes in functionality or usage
|
|
105
|
+
|
|
106
|
+
The body of the PR should include:
|
|
107
|
+
|
|
108
|
+
- A summary of the changes
|
|
109
|
+
- A special note of any changes to dependencies
|
|
110
|
+
- A link to any relevant issues or discussions
|
|
111
|
+
- Any additional context that may be helpful for reviewers
|
|
112
|
+
|
|
113
|
+
## Code Review Guidelines
|
|
114
|
+
|
|
115
|
+
When performing a code review, please follow these guidelines:
|
|
116
|
+
|
|
117
|
+
- If there are changes that modify the functionality/usage of the action, validate that there are changes in the
|
|
118
|
+
`README.md` file that document the new or modified functionality
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: github-actions
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
groups:
|
|
8
|
+
actions-minor:
|
|
9
|
+
update-types:
|
|
10
|
+
- minor
|
|
11
|
+
- patch
|
|
12
|
+
|
|
13
|
+
- package-ecosystem: npm
|
|
14
|
+
directory: /
|
|
15
|
+
schedule:
|
|
16
|
+
interval: weekly
|
|
17
|
+
groups:
|
|
18
|
+
npm-development:
|
|
19
|
+
dependency-type: development
|
|
20
|
+
update-types:
|
|
21
|
+
- minor
|
|
22
|
+
- patch
|
|
23
|
+
npm-production:
|
|
24
|
+
dependency-type: production
|
|
25
|
+
update-types:
|
|
26
|
+
- patch
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Create Release Notes
|
|
2
|
+
|
|
3
|
+
You are an expert technical writer tasked with creating release notes for updates to this repository. Your specific task
|
|
4
|
+
is to generate release notes that are clear, concise, and useful for developers and users of the project.
|
|
5
|
+
|
|
6
|
+
## Guidelines
|
|
7
|
+
|
|
8
|
+
Ensure you adhere to the following guidelines when creating release notes:
|
|
9
|
+
|
|
10
|
+
- Use a clear and consistent format for the release notes
|
|
11
|
+
- Include a summary of the changes made in the release
|
|
12
|
+
- Highlight any new features, improvements, or bugfixes
|
|
13
|
+
- If applicable, include instructions for upgrading or migrating to the new version
|
|
14
|
+
- Use technical language that is appropriate for the audience, but avoid jargon that may not be understood by all users
|
|
15
|
+
- Ensure that the release notes are easy to read and navigate
|
|
16
|
+
- Include relevant issue or PR numbers where applicable
|
|
17
|
+
- Use proper Markdown formatting
|
|
18
|
+
- Use code blocks for commands, configuration examples, or code changes
|
|
19
|
+
- Use note and warning callouts for important information
|
|
20
|
+
|
|
21
|
+
## Versioning
|
|
22
|
+
|
|
23
|
+
GitHub Actions are versioned using branch and tag names. The version in the project's `package.json` should reflect the
|
|
24
|
+
changes made in the codebase and follow [Semantic Versioning](https://semver.org/) principles. Depending on the nature
|
|
25
|
+
of the changes, please make sure to adjust the release notes accordingly:
|
|
26
|
+
|
|
27
|
+
- For **major** changes, include a detailed description of the breaking changes and how users can adapt to them
|
|
28
|
+
- For **minor** changes, highlight new features and improvements
|
|
29
|
+
- For **patch** changes, focus on bugfixes and minor improvements
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Create Unit Test(s)
|
|
2
|
+
|
|
3
|
+
You are an expert software engineer tasked with creating unit tests for the repository. Your specific task is to
|
|
4
|
+
generate unit tests that are clear, concise, and useful for developers working on the project.
|
|
5
|
+
|
|
6
|
+
## Guidelines
|
|
7
|
+
|
|
8
|
+
Ensure you adhere to the following guidelines when creating unit tests:
|
|
9
|
+
|
|
10
|
+
- Use a clear and consistent format for the unit tests
|
|
11
|
+
- Include a summary of the functionality being tested
|
|
12
|
+
- Use descriptive test names that clearly convey their purpose
|
|
13
|
+
- Ensure tests cover both the main path of success and edge cases
|
|
14
|
+
- Use proper assertions to validate the expected outcomes
|
|
15
|
+
- Use `jest` for writing and running tests
|
|
16
|
+
- Place unit tests in the `__tests__` directory
|
|
17
|
+
- Use fixtures for any necessary test data, placed in the `__fixtures__` directory
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
Use the following as an example of how to structure your unit tests:
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
/**
|
|
25
|
+
* Unit tests for the action's main functionality, src/main.ts
|
|
26
|
+
*/
|
|
27
|
+
import { jest } from '@jest/globals';
|
|
28
|
+
import * as core from '../__fixtures__/core.js';
|
|
29
|
+
import { wait } from '../__fixtures__/wait.js';
|
|
30
|
+
|
|
31
|
+
// Mocks should be declared before the module being tested is imported.
|
|
32
|
+
jest.unstable_mockModule('@actions/core', () => core);
|
|
33
|
+
jest.unstable_mockModule('../src/wait.js', () => ({ wait }));
|
|
34
|
+
|
|
35
|
+
// The module being tested should be imported dynamically. This ensures that the
|
|
36
|
+
// mocks are used in place of any actual dependencies.
|
|
37
|
+
const { run } = await import('../src/main.js');
|
|
38
|
+
|
|
39
|
+
describe('main.ts', () => {
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
// Set the action's inputs as return values from core.getInput().
|
|
42
|
+
core.getInput.mockImplementation(() => '500');
|
|
43
|
+
|
|
44
|
+
// Mock the wait function so that it does not actually wait.
|
|
45
|
+
wait.mockImplementation(() => Promise.resolve('done!'));
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
afterEach(() => {
|
|
49
|
+
jest.resetAllMocks();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('Sets the time output', async () => {
|
|
53
|
+
await run();
|
|
54
|
+
|
|
55
|
+
// Verify the time output was set.
|
|
56
|
+
expect(core.setOutput).toHaveBeenNthCalledWith(
|
|
57
|
+
1,
|
|
58
|
+
'time',
|
|
59
|
+
// Simple regex to match a time string in the format HH:MM:SS.
|
|
60
|
+
expect.stringMatching(/^\d{2}:\d{2}:\d{2}/),
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('Sets a failed status', async () => {
|
|
65
|
+
// Clear the getInput mock and return an invalid value.
|
|
66
|
+
core.getInput.mockClear().mockReturnValueOnce('this is not a number');
|
|
67
|
+
|
|
68
|
+
// Clear the wait mock and return a rejected promise.
|
|
69
|
+
wait.mockClear().mockRejectedValueOnce(new Error('milliseconds is not a number'));
|
|
70
|
+
|
|
71
|
+
await run();
|
|
72
|
+
|
|
73
|
+
// Verify that the action was marked as failed.
|
|
74
|
+
expect(core.setFailed).toHaveBeenNthCalledWith(1, 'milliseconds is not a number');
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: test
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- main
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
jobs:
|
|
12
|
+
test-action:
|
|
13
|
+
name: Actions Test / ${{ matrix.os }}
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
os:
|
|
19
|
+
- ${{ vars.RUNNER_ARM64 }}
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout
|
|
22
|
+
id: checkout
|
|
23
|
+
uses: actions/checkout@v6
|
|
24
|
+
- name: Test Local Action
|
|
25
|
+
id: test-action
|
|
26
|
+
uses: ./
|
|
27
|
+
- name: Print Output
|
|
28
|
+
id: output
|
|
29
|
+
shell: bash
|
|
30
|
+
run: |
|
|
31
|
+
echo '${{ steps.test-action.outputs.config }}' | jq .
|
|
32
|
+
packages="${{ fromJSON(steps.test-action.outputs.config).global.packages.Linux }}"
|
|
33
|
+
echo $packages
|
|
34
|
+
# pages="${{ fromJSON(steps.test-action.outputs.config).pages.mdbook.if }}"
|
|
35
|
+
|
|
36
|
+
# if [ "$pages" != "false" ]; then
|
|
37
|
+
# echo "pages should be false"
|
|
38
|
+
# exit 1
|
|
39
|
+
# fi
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name: jobtaker
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
types: [opened, synchronize, ready_for_review, reopened]
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
checks: write
|
|
8
|
+
pull-requests: write
|
|
9
|
+
id-token: write
|
|
10
|
+
jobs:
|
|
11
|
+
jobtaker:
|
|
12
|
+
name: bot
|
|
13
|
+
uses: ./.github/workflows/pr-review.yml
|
|
14
|
+
secrets: inherit
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
permissions:
|
|
3
|
+
contents: write
|
|
4
|
+
checks: write
|
|
5
|
+
on:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
version:
|
|
9
|
+
description: 'version to release'
|
|
10
|
+
required: true
|
|
11
|
+
type: choice
|
|
12
|
+
default: patch
|
|
13
|
+
options:
|
|
14
|
+
- patch
|
|
15
|
+
- rc
|
|
16
|
+
- minor
|
|
17
|
+
- beta
|
|
18
|
+
- alpha
|
|
19
|
+
- major
|
|
20
|
+
- release
|
|
21
|
+
runner:
|
|
22
|
+
description: 'Runner to use'
|
|
23
|
+
required: false
|
|
24
|
+
jobs:
|
|
25
|
+
releaser:
|
|
26
|
+
if: false
|
|
27
|
+
name: release
|
|
28
|
+
uses: ./.github/workflows/rust-release.yml
|
|
29
|
+
secrets: inherit
|
|
30
|
+
with:
|
|
31
|
+
version: ${{ inputs.version }}
|
|
32
|
+
package: 'dummy'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: dummy
|
|
2
|
+
permissions:
|
|
3
|
+
contents: read
|
|
4
|
+
checks: write
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches: [main]
|
|
8
|
+
pull_request:
|
|
9
|
+
jobs:
|
|
10
|
+
verify:
|
|
11
|
+
if: true
|
|
12
|
+
name: dummy
|
|
13
|
+
uses: ./.github/workflows/rust.yml
|
|
14
|
+
secrets: inherit
|
|
15
|
+
with:
|
|
16
|
+
runner: ${{ vars.RUNNER }}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Pages
|
|
2
|
+
permissions:
|
|
3
|
+
contents: write # To push a branch
|
|
4
|
+
pages: write # To push to a GitHub Pages site
|
|
5
|
+
id-token: write # To update the deployment status
|
|
6
|
+
on:
|
|
7
|
+
workflow_call:
|
|
8
|
+
inputs:
|
|
9
|
+
runner:
|
|
10
|
+
type: string
|
|
11
|
+
default: ${{ vars.RUNNER }}
|
|
12
|
+
required: false
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
config:
|
|
16
|
+
runs-on: ubicloud-standard-2
|
|
17
|
+
name: generate config
|
|
18
|
+
outputs:
|
|
19
|
+
config: ${{ steps.merge.outputs.config }}
|
|
20
|
+
steps:
|
|
21
|
+
- name: merge
|
|
22
|
+
id: merge
|
|
23
|
+
uses: dougefresh/ci/.github/actions/rust-config@main
|
|
24
|
+
with:
|
|
25
|
+
git_token: ${{ github.token }}
|
|
26
|
+
runner: ${{ inputs.runner }}
|
|
27
|
+
mdbook:
|
|
28
|
+
runs-on: ubicloud-standard-2
|
|
29
|
+
needs: ['config']
|
|
30
|
+
if: ${{ fromJSON(needs.config.outputs.config).pages.mdbook.if }}
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@v6
|
|
33
|
+
with:
|
|
34
|
+
fetch-depth: 0
|
|
35
|
+
# - name: Install latest mdbook
|
|
36
|
+
# run: |
|
|
37
|
+
# tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
|
|
38
|
+
# url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-aarch64-unknown-linux-gnu.tar.gz"
|
|
39
|
+
# mkdir mdbook
|
|
40
|
+
# curl -sSL $url | tar -xz --directory=./mdbook
|
|
41
|
+
# echo `pwd`/mdbook >> $GITHUB_PATH
|
|
42
|
+
- uses: jontze/action-mdbook@v4
|
|
43
|
+
name: Install mdBook
|
|
44
|
+
with:
|
|
45
|
+
token: ${{secrets.GITHUB_TOKEN}}
|
|
46
|
+
- name: Build Book
|
|
47
|
+
run: |
|
|
48
|
+
cd ${{ fromJSON(needs.config.outputs.config).pages.mdbook.path }}
|
|
49
|
+
${{ fromJSON(needs.config.outputs.config).pages.mdbook.command }}
|
|
50
|
+
|
|
51
|
+
- name: Setup Pages
|
|
52
|
+
uses: actions/configure-pages@v5
|
|
53
|
+
- name: Upload artifact
|
|
54
|
+
uses: actions/upload-pages-artifact@v4
|
|
55
|
+
with:
|
|
56
|
+
path: ${{ fromJSON(needs.config.outputs.config).pages.mdbook.path }}/book
|
|
57
|
+
- name: Deploy to GitHub Pages
|
|
58
|
+
id: deployment
|
|
59
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
name: jobtaker
|
|
2
|
+
on:
|
|
3
|
+
workflow_call:
|
|
4
|
+
permissions:
|
|
5
|
+
contents: read
|
|
6
|
+
checks: write
|
|
7
|
+
pull-requests: write
|
|
8
|
+
id-token: write
|
|
9
|
+
jobs:
|
|
10
|
+
|
|
11
|
+
config:
|
|
12
|
+
if: |
|
|
13
|
+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@jobtaker')) ||
|
|
14
|
+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@jobtaker')) ||
|
|
15
|
+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@jobtaker')) ||
|
|
16
|
+
(contains(github.event.pull_request.labels.*.name, 'jobtaker')) ||
|
|
17
|
+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@jobtaker') || contains(github.event.issue.title, '@jobtaker')))
|
|
18
|
+
runs-on: ${{ inputs.runner || vars.RUNNER }}
|
|
19
|
+
name: generate config
|
|
20
|
+
outputs:
|
|
21
|
+
config: ${{ steps.config.outputs.config }}
|
|
22
|
+
steps:
|
|
23
|
+
- name: Validate ANTHROPIC_API_KEY
|
|
24
|
+
shell: bash
|
|
25
|
+
run: |
|
|
26
|
+
if [ -z "${{ secrets.ANTHROPIC_API_KEY }}" ]; then
|
|
27
|
+
exit 1
|
|
28
|
+
fi
|
|
29
|
+
- name: config
|
|
30
|
+
id: config
|
|
31
|
+
uses: dougefresh/ci/.github/actions/rust-config@main
|
|
32
|
+
with:
|
|
33
|
+
arm64: ${{ vars.RUNNER_ARM64 }}
|
|
34
|
+
amd64: ${{ vars.RUNNER_AMD64 }}
|
|
35
|
+
git_token: ${{ github.token }}
|
|
36
|
+
jobtaker:
|
|
37
|
+
needs: [config]
|
|
38
|
+
if: |
|
|
39
|
+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@jobtaker')) ||
|
|
40
|
+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@jobtaker')) ||
|
|
41
|
+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@jobtaker')) ||
|
|
42
|
+
(contains(github.event.pull_request.labels.*.name, 'jobtaker')) ||
|
|
43
|
+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@jobtaker') || contains(github.event.issue.title, '@jobtaker')))
|
|
44
|
+
runs-on: ${{ vars.RUNNER }}
|
|
45
|
+
steps:
|
|
46
|
+
- name: checkout
|
|
47
|
+
uses: dougefresh/ci/.github/actions/rust-init@main
|
|
48
|
+
with:
|
|
49
|
+
packages: ${{ toJSON(fromJSON(needs.config.outputs.config).global.packages) }}
|
|
50
|
+
- name: jobtaker
|
|
51
|
+
if: ${{ fromJSON(needs.config.outputs.config).ai.enabled }}
|
|
52
|
+
uses: anthropics/claude-code-action@v1
|
|
53
|
+
with:
|
|
54
|
+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
55
|
+
trigger_phrase: '@jobtaker'
|
|
56
|
+
# settings: ${{ toJSON(fromJSON(needs.config.outputs.config).ai.settings) }}
|
|
57
|
+
# description: "Claude Code settings as JSON string or path to settings JSON file"
|
|
58
|
+
allowed_bots: ${{ fromJSON(needs.config.outputs.config).ai.allowed_bots }}
|
|
59
|
+
# description: "Comma-separated list of allowed bot usernames, or '*' to allow all bots. Empty string (default) allows no bots."
|
|
60
|
+
# Your custom review instructions
|
|
61
|
+
prompt: |
|
|
62
|
+
REPO: ${{ github.repository }}
|
|
63
|
+
PR NUMBER: ${{ github.event.pull_request.number }}
|
|
64
|
+
|
|
65
|
+
${{ fromJSON(needs.config.outputs.config).ai.prompt }}
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
${{ fromJSON(needs.config.outputs.config).ai.additional }}
|
|
70
|
+
# Tools for comprehensive PR review
|
|
71
|
+
claude_args: ${{ fromJSON(needs.config.outputs.config).ai.claude_args }}
|
|
72
|
+
use_sticky_comment: ${{ fromJSON(needs.config.outputs.config).ai.use_sticky_comment }}
|
|
73
|
+
# description: "Use just one comment to deliver issue/PR comments"
|
|
74
|
+
# required: false
|
|
75
|
+
# default: "false"
|
|
76
|
+
track_progress: "${{ fromJSON(needs.config.outputs.config).ai.track_progress }}"
|
|
77
|
+
# description: "Force tag mode with tracking comments for pull_request and issue events. Only applicable to pull_request (opened, synchronize, ready_for_review, reopened) and issue (opened, edited, labeled, assigned) events."
|
|
78
|
+
path_to_claude_code_executable: ''
|
|
79
|
+
# description: "Optional path to a custom Claude Code executable. If provided, skips automatic installation and uses this executable instead. WARNING: Using an older version may cause problems if the action begins taking advantage of new Claude Code features. This input is typically not needed unless you're debugging something specific or have unique needs in your environment."
|
|
80
|
+
path_to_bun_executable: ''
|
|
81
|
+
# description: "Optional path to a custom Bun executable. If provided, skips automatic Bun installation and uses this executable instead. WARNING: Using an incompatible version may cause problems if the action requires specific Bun features. This input is typically not needed unless you're debugging something specific or have unique needs in your environment."
|
|
82
|
+
show_full_output: 'false'
|
|
83
|
+
# description: "Show full JSON output from Claude Code. WARNING: This outputs ALL Claude messages including tool execution results which may contain secrets, API keys, or other sensitive information. These logs are publicly visible in GitHub Actions. Only enable for debugging in non-sensitive environments."
|
|
84
|
+
plugins: ''
|
|
85
|
+
# description: "Newline-separated list of Claude Code plugin names to install (e.g., 'code-review@claude-code-plugins\nfeature-dev@claude-code-plugins')"
|
|
86
|
+
plugin_marketplaces: ''
|
|
87
|
+
# description: "Newline-separated list of Claude Code plugin marketplace Git URLs to install from (e.g., 'https://github.com/user/marketplace1.git\nhttps://github.com/user/marketplace2.git')"
|
|
88
|
+
|
|
89
|
+
# When track_progress is enabled:
|
|
90
|
+
# - Creates a tracking comment with progress checkboxes
|
|
91
|
+
# - Includes all PR context (comments, attachments, images)
|
|
92
|
+
# - Updates progress as the review proceeds
|
|
93
|
+
# - Marks as completed when done
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: ci lib release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
release:
|
|
13
|
+
runs-on: ${{ vars.RUNNER }}
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
packages: write
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v6
|
|
19
|
+
|
|
20
|
+
- uses: oven-sh/setup-bun@v2
|
|
21
|
+
|
|
22
|
+
- name: Configure npm registry
|
|
23
|
+
run: |
|
|
24
|
+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
|
|
25
|
+
- name: Build
|
|
26
|
+
run: bun run build
|
|
27
|
+
- name: Get version
|
|
28
|
+
id: version
|
|
29
|
+
run: echo "tag=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
|
|
30
|
+
|
|
31
|
+
- name: Publish to GitHub Packages
|
|
32
|
+
run: bun publish
|
|
33
|
+
|
|
34
|
+
# - name: Publish to npm
|
|
35
|
+
# run: npm publish --access public
|
|
36
|
+
|
|
37
|
+
- uses: softprops/action-gh-release@v2
|
|
38
|
+
name: publish
|
|
39
|
+
with:
|
|
40
|
+
tag_name: ${{ steps.version.outputs.tag }}
|
|
41
|
+
generate_release_notes: true
|