Activity that queries GitHub.
It implements the stargazers:github/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_STARGAZERS environment variable.
export GITHUB_TOKEN_STARGAZERS="..."Build the activity and run Obelisk with obelisk-local.toml configuration in the root of the repository.
cargo build --release
obelisk server run --config ./obelisk-local.tomlIn another terminal run the activity.
obelisk execution submit --follow stargazers:github/account.account-info '["your-github-login"]'cargo nextest runexport TEST_GITHUB_TOKEN_STARGAZERS="..."
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_STARGAZERS" https://api.github.com/graphql \
-d @-