Activity that queries GitHub.
It implements the account WIT interface.
The account interface fetches basic info like repositories, contributions etc. for a given account.
Classic GitHub token with read:org permission is required.
The token must be accesible as GITHUB_TOKEN environment variable.
export GITHUB_TOKEN="..."Build the activity and run Obelisk with obelisk-local.toml.
just build
obelisk server run --deployment ./obelisk-local.tomlIn another terminal run the activity.
obelisk execution submit -f .../account.account-info -- '"your-github-login"'cargo nextest runexport TEST_GITHUB_TOKEN="..."
export TEST_GITHUB_LOGIN="..."
export TEST_GITHUB_REPO="..."
# optinally export TEST_GITHUB_STARGAZERS_CURSOR="..."
cargo nextest run -- --ignoredQUERY='
query QueryStargazers($repo: URI!, $page: Int!, $cursor: String) {
resource(url: $repo) {
... on Repository {
__typename
stargazers(first: $page, after: $cursor) {
nodes {
login
}
edges {
cursor
}
}
}
}
}
'
echo '
{"query":"'$(echo $QUERY)'", "variables":{"repo":"obeli-sk/obelisk", "page":2}}
' | curl -X POST \
-H "User-Agent: test" \
-H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/graphql \
-d @-