Skip to content

Commit

Permalink
Create initial implementation that will create a branch and add files…
Browse files Browse the repository at this point in the history
… to it (#5)

* Add GraphQL query for committing files

* Runs tests in CI

* Add queries for creating a branch from existing head
  • Loading branch information
s0 authored Jul 26, 2024
1 parent fce2760 commit 54fa882
Show file tree
Hide file tree
Showing 14 changed files with 3,487 additions and 83 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# needed got pnpm test:ci
GITHUB_TOKEN='<...some token>'
GITHUB_REPOSITORY=s0/ghcommit

# Debug Logging
# RUNNER_DEBUG=1
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const project = resolve(process.cwd(), "tsconfig.json");
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier"],
plugins: ["only-warn", "jest"],
plugins: ["jest"],
parser: "@typescript-eslint/parser",
globals: {
React: true,
Expand All @@ -29,10 +29,14 @@ module.exports = {
"node_modules/",
"dist/",
"coverage/",
"generated/",
],
overrides: [
{
files: ["*.js?(x)", "*.ts?(x)"],
},
],
rules: {
'no-unused-vars': 'off',
}
};
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: CI Checks
on: pull_request

permissions:
contents: write

jobs:
ci-checks:
runs-on: ubuntu-latest
Expand All @@ -22,3 +25,7 @@ jobs:
- run: pnpm build
- run: pnpm lint
- run: pnpm format:check
- run: pnpm test:ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_OID: ${{ github.base_ref }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ node_modules
coverage

# Build Outputs
generated
dist


# Debug
npm-debug.log*
yarn-debug.log*
Expand Down
18 changes: 16 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,41 @@
}
},
"scripts": {
"build": "tsup",
"build": "pnpm codegen:github && tsc --noEmit && tsup",
"codegen:github": "graphql-codegen --config src/github/codegen.ts",
"format:check": "prettier --check \"**/*.{ts,tsx,md}\"",
"format:fix": "prettier --write \"**/*.{ts,tsx,md}\"",
"lint": "eslint . --max-warnings 0",
"test": "jest",
"test:watch": "jest --watch"
"test:watch": "jest --watch",
"test:ci": "ts-node src/test/ci"
},
"devDependencies": {
"@actions/github": "^6.0.0",
"@changesets/cli": "^2.27.7",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/import-types-preset": "^3.0.0",
"@graphql-codegen/typescript": "^4.0.4",
"@graphql-codegen/typescript-operations": "^4.0.4",
"@octokit/core": "^6.1.2",
"@octokit/graphql": "^8.1.1",
"@octokit/graphql-schema": "^14.56.0",
"@types/eslint": "^8.56.5",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.24",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-only-warn": "^1.1.0",
"jest": "^29.7.0",
"pino": "^9.3.2",
"pino-pretty": "^11.2.2",
"prettier": "^3.3.3",
"ts-jest": "^29.2.0",
"ts-node": "^10.9.2",
"tsup": "^8.1.0",
"typescript": "^5.3.3"
},
Expand Down
Loading

0 comments on commit 54fa882

Please sign in to comment.