Skip to content

Instantly share code, notes, and snippets.

@gr2m
Created May 6, 2021 20:30
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 gr2m/b336c3c76de58a7b65299b9e224564c5 to your computer and use it in GitHub Desktop.
Save gr2m/b336c3c76de58a7b65299b9e224564c5 to your computer and use it in GitHub Desktop.
//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