Skip to content

Commit 54fa882

Browse files
authored
Create initial implementation that will create a branch and add files to it (#5)
* Add GraphQL query for committing files * Runs tests in CI * Add queries for creating a branch from existing head
1 parent fce2760 commit 54fa882

File tree

14 files changed

+3487
-83
lines changed

14 files changed

+3487
-83
lines changed

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# needed got pnpm test:ci
2+
GITHUB_TOKEN='<...some token>'
3+
GITHUB_REPOSITORY=s0/ghcommit
4+
5+
# Debug Logging
6+
# RUNNER_DEBUG=1

.eslintrc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const project = resolve(process.cwd(), "tsconfig.json");
66
/** @type {import("eslint").Linter.Config} */
77
module.exports = {
88
extends: ["eslint:recommended", "prettier"],
9-
plugins: ["only-warn", "jest"],
9+
plugins: ["jest"],
1010
parser: "@typescript-eslint/parser",
1111
globals: {
1212
React: true,
@@ -29,10 +29,14 @@ module.exports = {
2929
"node_modules/",
3030
"dist/",
3131
"coverage/",
32+
"generated/",
3233
],
3334
overrides: [
3435
{
3536
files: ["*.js?(x)", "*.ts?(x)"],
3637
},
3738
],
39+
rules: {
40+
'no-unused-vars': 'off',
41+
}
3842
};

.github/workflows/ci.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: CI Checks
22
on: pull_request
33

4+
permissions:
5+
contents: write
6+
47
jobs:
58
ci-checks:
69
runs-on: ubuntu-latest
@@ -22,3 +25,7 @@ jobs:
2225
- run: pnpm build
2326
- run: pnpm lint
2427
- run: pnpm format:check
28+
- run: pnpm test:ci
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
HEAD_OID: ${{ github.base_ref }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ node_modules
1616
coverage
1717

1818
# Build Outputs
19+
generated
1920
dist
2021

21-
2222
# Debug
2323
npm-debug.log*
2424
yarn-debug.log*

package.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,41 @@
2626
}
2727
},
2828
"scripts": {
29-
"build": "tsup",
29+
"build": "pnpm codegen:github && tsc --noEmit && tsup",
30+
"codegen:github": "graphql-codegen --config src/github/codegen.ts",
3031
"format:check": "prettier --check \"**/*.{ts,tsx,md}\"",
3132
"format:fix": "prettier --write \"**/*.{ts,tsx,md}\"",
3233
"lint": "eslint . --max-warnings 0",
3334
"test": "jest",
34-
"test:watch": "jest --watch"
35+
"test:watch": "jest --watch",
36+
"test:ci": "ts-node src/test/ci"
3537
},
3638
"devDependencies": {
39+
"@actions/github": "^6.0.0",
3740
"@changesets/cli": "^2.27.7",
41+
"@graphql-codegen/cli": "^5.0.2",
42+
"@graphql-codegen/import-types-preset": "^3.0.0",
43+
"@graphql-codegen/typescript": "^4.0.4",
44+
"@graphql-codegen/typescript-operations": "^4.0.4",
45+
"@octokit/core": "^6.1.2",
46+
"@octokit/graphql": "^8.1.1",
47+
"@octokit/graphql-schema": "^14.56.0",
3848
"@types/eslint": "^8.56.5",
3949
"@types/jest": "^29.5.12",
4050
"@types/node": "^20.11.24",
4151
"@typescript-eslint/eslint-plugin": "^7.16.0",
4252
"@typescript-eslint/parser": "^7.16.0",
53+
"dotenv": "^16.4.5",
4354
"eslint": "^8.57.0",
4455
"eslint-config-prettier": "^9.1.0",
4556
"eslint-plugin-jest": "^28.6.0",
4657
"eslint-plugin-only-warn": "^1.1.0",
4758
"jest": "^29.7.0",
59+
"pino": "^9.3.2",
60+
"pino-pretty": "^11.2.2",
4861
"prettier": "^3.3.3",
4962
"ts-jest": "^29.2.0",
63+
"ts-node": "^10.9.2",
5064
"tsup": "^8.1.0",
5165
"typescript": "^5.3.3"
5266
},

0 commit comments

Comments
 (0)