Created
May 6, 2021 20:30
-
-
Save gr2m/b336c3c76de58a7b65299b9e224564c5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//Shortcut: command shift - | |
// Menu: Set GitHub Status | |
// Description: Sets the status text on your GitHub Profile | |
const message = await arg("What would you like to say?"); | |
const token = await env("GITHUB_STATUS_TOKEN", { | |
secret: true, | |
ignoreBlur: true, | |
hint: md( | |
`Create a token [on GitHub](https://github.com/settings/tokens/new?scopes=user&description=kit%20script)` | |
), | |
}); | |
const response = await post( | |
"https://api.github.com/graphql", | |
{ | |
query: `mutation ($text:String) { | |
changeUserStatus(input:{message:$text}) { | |
status { | |
message | |
} | |
} | |
}`, | |
variables: { | |
text: message, | |
}, | |
}, | |
{ | |
headers: { | |
authorization: `token ${token}`, | |
}, | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment