Where the world builds software. Millions of developers and companies build, ship, and maintain their software on GitHub—the largest and most advanced development platform in the world.
Go to siteimport { axios } from "@pipedream/platform"
export default defineComponent({
props: {
github: {
type: "app",
app: "github",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.github.com/user`,
headers: {
Authorization: `Bearer ${this.github.$auth.oauth_access_token}`,
"X-GitHub-Api-Version": `2022-11-28`,
},
})
},
})
The Github triggers in Pipedream enable you to get notified immediately via a webhook if you have admin
rights on the repo you're watching. Otherwise you can still poll for updates at a regular interval for any other repo where you might not have admin
rights.
Example: New or Updated Issue If you are an admin on the repo, this trigger will be configured as a webhook — so any time there is a new or updated issue in the repo, an event will immediately get emitted.
If you do not have admin
rights on the repo you're watching, you can configure the Pipedream trigger to poll for updates on a regular interval.
Emit new event when a (classic) project card is created or moved to a specific column. For Projects V2 use New Issue with Status
trigger. More information here
Emit new event when a collaborator is added See the documentation
Emit new event when commits are pushed to a branch See the documentation
Emit new event when a commit comment is created See the documentation
GitHub uses OAuth authentication. When you connect your GitHub account, Pipedream will open a popup window where you can sign into GitHub and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any GitHub API.
Pipedream requests the following authorization scopes when you connect your account:
repo
admin:org
admin:public_key
admin:org_hook
gist
project
notifications
user
write:discussion
write:packages
read:packages
admin:repo_hook
GET
https://github.com/login/oauth/authorize
?
client_id={{oauth.client_id}}
&
state={{oauth.state}}
&
redirect_uri={{oauth.redirect_uri}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
&
login=
POST
https://github.com/login/oauth/access_token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=authorization_code
&
code={{oauth.code}}