{"id":14976032,"url":"https://github.com/gm3dmo/the-power","last_synced_at":"2025-04-13T07:47:54.654Z","repository":{"id":56807844,"uuid":"525661193","full_name":"gm3dmo/the-power","owner":"gm3dmo","description":"The Power is a bunch of test scripts that share a single centralized configuration file for use with GitHub API's. It's commonly used by folks with a need to teach, learn, debug against GItHub's API's in a rapid fashion. It aims to be the fastest way to demo any feature of GitHub.","archived":false,"fork":false,"pushed_at":"2025-04-10T13:53:10.000Z","size":4264,"stargazers_count":174,"open_issues_count":33,"forks_count":35,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-04-13T07:47:41.677Z","etag":null,"topics":["api","github","graphql","graphql-api","rest"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gm3dmo.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-17T06:06:09.000Z","updated_at":"2025-04-11T19:29:27.000Z","dependencies_parsed_at":"2023-12-20T15:48:34.103Z","dependency_job_id":"fc2edda4-d796-4f20-a9fb-33401b1abf64","html_url":"https://github.com/gm3dmo/the-power","commit_stats":{"total_commits":939,"total_committers":18,"mean_commits":"52.166666666666664","dds":"0.11927582534611292","last_synced_commit":"4d79a512b364ac4686e00c486f3ec2cb768e23a5"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gm3dmo%2Fthe-power","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gm3dmo%2Fthe-power/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gm3dmo%2Fthe-power/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gm3dmo%2Fthe-power/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gm3dmo","download_url":"https://codeload.github.com/gm3dmo/the-power/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","github","graphql","graphql-api","rest"],"created_at":"2024-09-24T13:53:11.291Z","updated_at":"2025-04-13T07:47:54.622Z","avatar_url":"https://github.com/gm3dmo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Power\n\n![the-power](https://github.com/gm3dmo/the-power/actions/workflows/the-power.yml/badge.svg)\n\n\n## Table of Contents\n\n1. [What is the Power?](#what-is-the-power)\n2. [Setup Instructions](setup.md)\n3. [Contributing to The Power](CONTRIBUTING.md)\n4. [Known Issues/Problems/Solutions](known-issues.md)\n5. [Testcases](testcases.md)\n6. [Setting up a GitHub App to use with The Power](setting-up-a-gh-app.md)\n7. [GitHub API Learning Resources](resources.md)\n8. [Scaling to create larger environments](scale.md)\n\n## What is The Power?\n*The Power* is a simple test framework for GitHub's API's. It's goal is to help you learn to interact with and understand GitHub API's by building test scenarios such as; a repository with a pull request, teams and users on a testing instance of [GitHub Enterprise](https://docs.github.com/en/enterprise-server/admin/overview/about-github-enterprise-server) or GitHub.com a pre-existing [Organization](https://docs.github.com/en/organizations/collaborating-with-groups-in-organizations/about-organizations) and [Enterprise Account](https://docs.github.com/en/get-started/onboarding/getting-started-with-github-enterprise-cloud).\n\nThe Power can create the following on a blank appliance or organization in \u003c=30 seconds:\n\n* An [Organization](https://docs.github.com/en/organizations/collaborating-with-groups-in-organizations/about-organizations).\n* Users\n* A [team](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams) of users.\n* A private [repository](https://docs.github.com/en/repositories) named *testrepo* with a [branch](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-and-deleting-branches-within-your-repository) called *new_branch*,\n* [Branch protection](https://docs.github.com/en/github/administering-a-repository/about-protected-branches) rules on branch `main`.\n* [*CODEOWNERS*](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners) file configured for the *README.md* and `.gitattributes` files.\n* An [Issue](https://github.com/features/issues) with the [label](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels) `bug`.\n* A [pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) with a code owner requested for review. The pull request contains 2 commits against 2 files and activates the tree view.\n* A manifest file for a package manager file with a vulnerability to trigger [Dependabot](https://docs.github.com/en/code-security/dependabot).\n* A [webhook](https://docs.github.com/en/developers/webhooks-and-events/about-webhooks) on *testrepo* that outputs to it's own [smee.io](https://smee.io) url.\n* A [Release](https://docs.github.com/en/github/administering-a-repository/managing-releases-in-a-repository).\n* [GitHub Pages](https://docs.github.com/en/pages) configured for *testrepo*.\n* A [Gist](https://docs.github.com/en/github/writing-on-github/creating-gists).\n* Mermaid diagrams using [create-commit-mermaid.sh](create-commit-mermaid.sh) to demonstrate the GitHub supported diagram types on [the mermaid project](https://mermaid-js.github.io/mermaid/#/n00b-gettingStarted).\n\nThere are many other features and test-cases you can use or adapt to build scenarios of your own.\n\n\u003e [!NOTE]  \n\u003e The power is not intended as an example of how to write shell scripts.\n\n\n### The Power is a tool for learning\n- Designed to be as simple as possible to understand. To keep things simple we exclusively uses only `curl` and `jq` to complete most tasks. Only a few of the more complex scenarios have other dependencies.\n\n### The Power is vast and deep\nThere are hundreds of pre-baked scripts to:\n\n* Create commits, secrets, hooks, issue comments, environments.\n* Bulk up your appliance by creating hundreds or thousands of users/orgs/repos/teams/pull requests.\n* Set up a Tiny [GitHub App](https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps) in less than 1 minute.\n* Demonstrate [GitHub Actions](https://docs.github.com/en/actions).\n* Demonstrate [Code scanning](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning).\n\n### The Power is fast\nYou can stitch together scripts to create demos of features or rapidly test a bug or capability.\n\n- [The Base Testcase: build-testcase](https://www.youtube.com/watch?v=yB55AVjM7DY) demo of the features of The Power's base test case `build-testcase`.\n- [Push Protection Speed Run](https://www.youtube.com/watch?v=0rzGeNt0Na0) a speed run demo of GitHub Push Protection feature.\n- [Secret Scanning Speed Run](https://www.youtube.com/watch?v=CvEMjQ0YZ0I) creates a repository, enables secret scanning, clones the repository and leaves you ready to commit secrets using [build-testcase-secret-scanning](https://github.com/gm3dmo/the-power/blob/main/build-testcase-secret-scanning).\n- [GitHub App Commit Signing Demo](https://www.youtube.com/watch?v=xRLtkkl4w7I) uses the [run-testcase-tiny-app-commit-signing](https://github.com/gm3dmo/the-power/blob/main/run-testcase-tiny-app-commit-signing) testcase to demonstrate a GitHub App.\n- [Build a Simple GitHub Actions Workflow](https://www.youtube.com/watch?v=MNu2LjIImK4) uses the [build-testcase-workflow-simple](https://github.com/gm3dmo/the-power/blob/main/build-testcase-workflow-simple) script to demonstrate building a GitHub Actions Workflow.\n\n### The Power is highly configurable\nThe configuration file `.gh-api.examples.conf` is the green fuse that drives The Power. The configuration file format is a simple list of key value pairs:\n\n```\n### [Branches](https://docs.github.com/en/rest/commits/commits)\n# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/\nproposing-changes-to-your-work-with-pull-requests/about-branches\nbranch_name=\"new_branch\"\nprotected_branch_name=\"main\"\nrequired_approving_reviewers=1\nrequired_status_check_name=\"ci-test/this-check-is-required\"\nenforce_admins=\"false\"\nbase_branch=main\n```\n\n#### The Power's configuration can be shared with other tools\nThe use of `kv` pairs in `.gh-api-examples.conf` provides maximum flexibility and simplicity. It allows the configuration file to provide the basic descriptors for other more advanced tools like Apache JMeter or [hurl](https://hurl.dev/)\n\n##### Hurl using the `.gh-api-examples.conf file`\n[hurl-repo-characteristics.sh](https://github.com/gm3dmo/the-power/blob/main/hurl-repo-characteristics.sh) shows [hurl](https://hurl.dev) provisioned with values `.gh-api-examples.conf`:\n\n```\nhurl --test --variables-file .gh-api-examples.conf --json hurl-tests/repo-characteristics.hurl | jq -r\n```\nThe `hurl-tests/repo-characteristics` file looks like:\n\n```\nGET {{ GITHUB_API_BASE_URL }}/repos/{{ org }}/{{ repo }}\nAccept: application/vnd.github.v3+json\nAuthorization: token {{ GITHUB_TOKEN }}\n\nHTTP/2 200\n\n[Asserts]\nstatus \u003e= 200\nstatus \u003c 300\nheader \"Content-Type\" == \"application/json; charset=utf-8\"\nheader \"x-github-request-id\" isString\njsonpath \"$.name\" == \"{{ repo }}\"\njsonpath \"$.full_name\" == \"{{ org}}/{{ repo }}\"\n```\n\n### Why The Power\nThere are lots of great tools like [JMeter](https://jmeter.apache.org/) for interacting with API's and building testsuites and many of the latest API's come with their own interactive documentation built-in like the [swagger petstore](https://petstore.swagger.io/). The Power is a solution for times and places where those tools just aren't available.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgm3dmo%2Fthe-power","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgm3dmo%2Fthe-power","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgm3dmo%2Fthe-power/lists"}