{"id":16630867,"url":"https://github.com/ryanclark/gamma","last_synced_at":"2025-08-14T11:44:08.777Z","repository":{"id":64012721,"uuid":"566304039","full_name":"ryanclark/gamma","owner":"ryanclark","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-30T15:38:41.000Z","size":135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-12T10:49:23.166Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanclark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-15T11:50:13.000Z","updated_at":"2022-11-24T15:04:38.000Z","dependencies_parsed_at":"2023-01-14T18:48:05.259Z","dependency_job_id":null,"html_url":"https://github.com/ryanclark/gamma","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":"0.030303030303030276","last_synced_commit":"791532e7e0168c0685fd46c1a339ffec6b2d3b9a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ryanclark/gamma","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanclark%2Fgamma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanclark%2Fgamma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanclark%2Fgamma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanclark%2Fgamma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanclark","download_url":"https://codeload.github.com/ryanclark/gamma/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanclark%2Fgamma/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270414550,"owners_count":24579552,"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","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-12T04:49:42.149Z","updated_at":"2025-08-14T11:44:08.727Z","avatar_url":"https://github.com/ryanclark.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gamma, by [Teleport](https://goteleport.com)\r\n\r\n_**G**ithub **A**ctions **M**onorepo **M**agic **A**utomation_\r\n\r\nGamma is a tool that sets out to solve a few shortcomings when it comes to managing and maintaining multiple GitHub actions.\r\n\r\n## What does it do?\r\n\r\n- 🚀 No more including the compiled source code in your commits\r\n- 🚀 Automatically build all your actions into individual, publishable repos \r\n- 🚀 Share schema definitions between actions\r\n- 🚀 Version all actions separately\r\n\r\nGamma allows you to have a monorepo of actions that are then built and deployed into individual repos. Having each action in its own repo allows for the action to be published on the Github Marketplace.\r\n\r\nGamma also goes further when it comes to sharing common `action.yml` attributes between actions. Actions in your monorepo can extend upon other YAML files and bring in their `inputs`, `branding`, etc - reducing code duplication and making things easier to maintain.\r\n\r\n## How to use\r\n\r\nThis assumes you're using `yarn` with workspaces. Each workspace is an action.\r\n\r\nYour root `package.json` should look like:\r\n\r\n```json\r\n{\r\n  \"name\": \"actions-monorepo\",\r\n  \"private\": true,\r\n  \"workspaces\": [\r\n    \"actions/*\"\r\n  ]\r\n}\r\n```\r\n\r\nEach action then lives under the `actions/` directory. \r\n\r\nEach action should be able to be built via `yarn build`. We recommend [ncc](https://github.com/vercel/ncc) for building your actions. The compiled source code should end up in a `dist` folder, relative to the action. You should add `dist/` to your `.gitignore`.\r\n\r\n`actions/example/package.json`\r\n\r\n```json\r\n{\r\n  \"name\": \"example\",\r\n  \"version\": \"1.0.0\",\r\n  \"repository\": \"https://github.com/mono-actions/example.git\",\r\n  \"scripts\": {\r\n    \"build\": \"ncc build ./src/index.ts -o dist\"\r\n  },\r\n  \"dependencies\": {\r\n    \"@actions/core\": \"^1.10.0\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"@types/node\": \"^18.8.2\",\r\n    \"@vercel/ncc\": \"^0.34.0\",\r\n    \"typescript\": \"^4.8.4\"\r\n  }\r\n}\r\n```\r\n\r\nThe `repository` field is where the compiled action will deployed to.\r\n\r\n`actions/example/action.yml`\r\n\r\nThis is where Gamma can really shine. You can define your `action.yml` as normal, whilst also extending on other YAML files for common attributes.\r\n\r\n```yaml\r\nname: Example Action\r\ndescription: This is an example action\r\nextend:\r\n  - from: '@/shared/common.yml'\r\n    include:\r\n      - field: inputs\r\n        include:\r\n          - version\r\n      - field: runs\r\n      - field: author\r\n      - field: branding\r\n```\r\n\r\n`@/` refers to the root of the directory. `@/shared/common.yml` would resolve to `shared/common.yml`, which can look like this:\r\n\r\n`shared/common.yml`\r\n\r\n```yaml\r\nauthor: Gravitational, Inc.\r\ninputs:\r\n  version:\r\n    required: true\r\n    description: 'Specify the version without the preceding \"v\"'\r\nbranding:\r\n  icon: terminal\r\n  color: purple\r\nruns:\r\n  using: node16\r\n  main: dist/index.js\r\n```\r\n\r\nGamma will compile this and publish the final `action.yml` to the correct repository.\r\n\r\n`github.com/mono-actions/example/action.yml`\r\n\r\n```yaml\r\nname: Example Action\r\ndescription: This is an example action\r\nauthor: Gravitational Inc.\r\ninputs:\r\n    version:\r\n        description: Specify the version without the preceding \"v\"\r\n        required: true\r\nruns:\r\n    using: node16\r\n    main: dist/index.js\r\nbranding:\r\n    icon: terminal\r\n    color: purple\r\n```\r\n\r\nThe built source code will also be committed, so you end up with a publishable Github Action.\r\n\r\n## Setup\r\n\r\nGamma itself is a Github Action that you can use in your workflows.\r\n\r\nYou will need to [create a Github Application](https://docs.github.com/en/developers/apps/building-github-apps/creating-a-github-app) for Gamma to use. This should have write access to all the repos that you are deploying to.\r\n\r\nYou'll need to install your application in the organisation, and grab the installation number.\r\n\r\nGamma requires the following environment variables. You should set these as secrets in the repo, and pass them through in the workflow configuration.\r\n\r\n**NOTE:** You can't prefix secrets with `GITHUB_` - you can use something like `GH_` instead.\r\n\r\n`GITHUB_APP_INSTALLATION_ID` \r\n\r\nOnce you've installed the app to your organisation, you can find this in the URL\r\n\r\nIt'll look something like https://github.com/organizations/mono-actions/settings/installations/31502012\r\n\r\nYou'll want to take `31502012` from the URL.\r\n\r\n`GITHUB_APP_ID`\r\n\r\nThis is the \"App ID\" in the Github Application's settings.\r\n\r\n`GITHUB_APP_PRIVATE_KEY`\r\n\r\nWhen you create your application, you'll be prompted to create a private key. Copy the contents into the secret field.\r\n\r\n### Deployment\r\n\r\nOnce your Github application has been created and the secrets have been set in your monorepo, you can use Gamma in your workflow.\r\n\r\nHere's an example configuration for deploying the actions on a commit into `main`.\r\n\r\n`.github/workflows/deploy.yml`\r\n\r\n```yaml\r\nname: Deploy actions\r\n\r\non:\r\n  push:\r\n    branches:\r\n      - main\r\n\r\njobs:\r\n  deploy:\r\n    runs-on: ubuntu-latest\r\n\r\n    steps:\r\n      - uses: actions/checkout@v3\r\n        with:\r\n          fetch-depth: 0 # Make sure you set this, as Gamma needs the Git history\r\n\r\n      - uses: actions/setup-node@v3\r\n        \r\n      - uses: gravitational/setup-gamma@v1\r\n\r\n      - run: yarn # Install your dependencies as normal\r\n\r\n      - run: yarn test # Test your actions, if you have tests\r\n\r\n      - name: Deploy actions\r\n        run: gamma deploy\r\n        env:\r\n          GITHUB_APP_INSTALLATION_ID: ${{ secrets.GH_APP_INSTALLATION_ID }}\r\n          GITHUB_APP_ID: ${{ secrets.GH_APP_ID }}\r\n          GITHUB_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }}\r\n```\r\n\r\nGamma will check what files have changed from HEAD and the previous commit. For this reason, you should only use squash \u0026 merge when merging pull requests.\r\n\r\nOnce it's detected the changed files, it'll check which actions have file changes and only build and deploy the changes needed.\r\n\r\nGamma mirrors the commit message - if you commit to the monorepo a message such as `\"Update the README to add an example\"`, it'll commit to the destination repository with the same commit message.\r\n\r\n### Testing pull requests\r\n\r\nIt's also important to check that Gamma can build the action and compile the `action.yml` for pull requests. To do this, you can use the `gamma build` command instead.\r\n\r\n`.github/workflows/build.yml`\r\n\r\n```yaml\r\nname: Build actions\r\n\r\non:\r\n  pull_request:\r\n\r\njobs:\r\n  build:\r\n    runs-on: ubuntu-latest\r\n\r\n    steps:\r\n      - uses: actions/checkout@v3\r\n\r\n      - uses: actions/setup-node@v3\r\n\r\n      - uses: gravitational/setup-gamma@v1\r\n\r\n      - run: yarn # Install your dependencies as normal\r\n        \r\n      - run: yarn test # Test your actions, if you have tests\r\n\r\n      - name: Build actions\r\n        run: gamma build\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanclark%2Fgamma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanclark%2Fgamma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanclark%2Fgamma/lists"}