Skip to content

Instantly share code, notes, and snippets.

@ctrlaltdylan
Created December 6, 2022 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctrlaltdylan/dfd12bc8dbe812b582dda72d1badbb2a to your computer and use it in GitHub Desktop.
Save ctrlaltdylan/dfd12bc8dbe812b582dda72d1badbb2a to your computer and use it in GitHub Desktop.
Create Github Repository from a Pipedream Node.js Code Step
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
github: {
type: "app",
app: "github",
},
repo_name: {
type: "string",
label: "Repository Name",
description: "The name of the repository to be created."
}
},
async run({steps, $}) {
return await axios($, {
method: 'POST',
url: `https://api.github.com/user/repos`,
headers: {
Authorization: `Bearer ${this.github.$auth.oauth_access_token}`,
"X-GitHub-Api-Version": `2022-11-28`,
},
data: {
name: this.repo_name,
}
})
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment