Created
December 6, 2022 14:12
-
-
Save ctrlaltdylan/dfd12bc8dbe812b582dda72d1badbb2a to your computer and use it in GitHub Desktop.
Create Github Repository from a Pipedream Node.js Code Step
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
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