generated from Bullrich/parity-action-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update branch option before
auto-merge
(#30)
- Added option to update a branch before enabling `auto-merge`. - Resolves #23 - Updated graphql hardcoded strings to work as `.graphql` files with auto-type generation. - Updated version to `1.1.0`
- Loading branch information
Showing
18 changed files
with
3,013 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
dist | ||
.git | ||
src/github/graphql/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,5 @@ | |
!.vscode/extensions.json | ||
!.vscode/settings.json | ||
.idea | ||
|
||
src/github/graphql/*.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
import type { CodegenConfig } from '@graphql-codegen/cli'; | ||
|
||
const config: CodegenConfig = { | ||
overwrite: true, | ||
schema: "./node_modules/@octokit/graphql-schema/schema.graphql", | ||
documents: "src/**/*.gql", | ||
generates: { | ||
"src/github/graphql/index.ts": { | ||
plugins: ["typescript", "typescript-operations"], | ||
} | ||
} | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const { readdirSync, writeFileSync, readFileSync } = require("fs"); | ||
|
||
const files = readdirSync("src/github/graphql/"); | ||
|
||
/** | ||
* Copy a file and replace it's extension | ||
* @param {string} fileName Name of the file to copy | ||
* @param {string} extension New extension to put | ||
*/ | ||
const copyFile = (fileName, extension) => { | ||
console.log("Copying content of %s into a .ts file", fileName); | ||
const content = readFileSync(fileName); | ||
const oldExtension = fileName.split(".").pop(); | ||
writeFileSync( | ||
fileName.replace(oldExtension, extension), | ||
`// Generated from ${fileName}\nexport default \`${content}\`;`, | ||
); | ||
}; | ||
|
||
for (const file of files) { | ||
if (file.endsWith(".gql")) { | ||
copyFile(`src/github/graphql/${file}`, "ts"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mutation DisableAutoMerge($prId: ID!) { | ||
disablePullRequestAutoMerge(input: {pullRequestId: $prId}) { | ||
clientMutationId | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mutation EnableAutoMerge($prId: ID!, $mergeMethod: PullRequestMergeMethod!) { | ||
enablePullRequestAutoMerge(input: {pullRequestId: $prId, mergeMethod: $mergeMethod}) { | ||
clientMutationId | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mutation MergePullRequest($prId: ID!, $mergeMethod: PullRequestMergeMethod!) { | ||
mergePullRequest(input: {pullRequestId: $prId, mergeMethod: $mergeMethod}) { | ||
clientMutationId | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
mutation UpdatePullRequestBranch($prId: ID!) { | ||
updatePullRequestBranch(input: {pullRequestId: $prId}) { | ||
clientMutationId | ||
pullRequest { | ||
title | ||
number | ||
headRefName | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,6 @@ | |
}, | ||
"exclude": [ | ||
"node_modules", | ||
"codegen.ts" | ||
] | ||
} |
Oops, something went wrong.