{"id":20438162,"url":"https://github.com/kiprasmel/git-publish-generated-branch","last_synced_at":"2026-04-20T13:33:26.627Z","repository":{"id":52013627,"uuid":"520712215","full_name":"kiprasmel/git-publish-generated-branch","owner":"kiprasmel","description":"create \u0026 update derived git branches for hosting generated content","archived":false,"fork":false,"pushed_at":"2022-08-03T16:12:23.000Z","size":52,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-20T22:35:26.220Z","etag":null,"topics":["branch","derived","generated","git","github-actions"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/kiprasmel.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-08-03T02:30:23.000Z","updated_at":"2023-11-01T18:35:08.000Z","dependencies_parsed_at":"2023-01-11T17:23:12.858Z","dependency_job_id":null,"html_url":"https://github.com/kiprasmel/git-publish-generated-branch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiprasmel%2Fgit-publish-generated-branch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiprasmel%2Fgit-publish-generated-branch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiprasmel%2Fgit-publish-generated-branch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiprasmel%2Fgit-publish-generated-branch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiprasmel","download_url":"https://codeload.github.com/kiprasmel/git-publish-generated-branch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241983295,"owners_count":20052649,"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":["branch","derived","generated","git","github-actions"],"created_at":"2024-11-15T09:09:32.072Z","updated_at":"2026-04-20T13:33:21.606Z","avatar_url":"https://github.com/kiprasmel.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-publish-generated-branch\n\nsituation:\n\n- you have something (source code, template, etc) that generates a build/binary/static assets/etc.\n- you want to store this generated output in a different branch,\n- you want these contents to be right at the root of the repository (so that the output path is inlined / other tools don't need to know it, \u0026 instead they only need the branch name)\n\nhere, you can use git-publish-generated-branch.\n\n- it expects that you've generated your build,\n- takes it's path,\n- creates or re-uses a branch of a specific name that's derived from the current branch,\n- overrides the root dir of the repo to the built contents,\n- commits the change and\n- pushes it to the remote branch.\n\n## Usage\n\n```sh\n$ git-publish-generated-branch --help\n\nusage:\n\ngit-publish-generated-branch \u003cBUILD_DIR\u003e --branch-prefix \u003cPREFIX=\"x-build/\"\u003e\ngit-publish-generated-branch \u003cBUILD_DIR\u003e --branch \u003cFULL_NAME_OF_NEW_BRANCH=\"{prefix}{current-branch}\"\u003e\n\nrequired:\n    [--dir] BUILD_DIR\n\n\noptional:\n    -p, --branch-prefix                    = \"x-build/\"\n    -b, --branch                           = \"{prefix}{current-branch}\"\n\n        --no-exit-on-changes-outside-build = 0 (exits if changes detected outside build dir)\n        --extra-commit-body                = \"\"\n        --remote                           = origin\n\n    -V, --version\n    -h, --help\n\n\ngit-publish-generated-branch v0\n```\n\n## Usage as GitHub Action\n\n```yml\n# your-workflow.yml\n\nname: \u003cyour-workflow\u003e\n\non:\n  workflow_dispatch:\n    # manual trigger\n  push:\n    # on push to any branch, excluding our generated ones\n    branches-ignore:\n      - 'x-build/*'\n\n      # TODO - will need this after testing.\n      # or a general way to specify the default branch.\n      # because too much activity, even w/ pull --rebase,\n      # can become incorrect.\n      # and in general, u shouldn't need to load from master,\n      # since it's what's in production already.\n      #\n      # - \"master\"\n\njobs:\t\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v2\n        with:\n          # see https://github.com/actions/checkout/issues/217\n          # TODO optimise perf?\n          # TODO also fix for v3, because currently works only with v2 (because of https://github.com/actions/checkout/issues/217#issuecomment-634802933 )\n          fetch-depth: 0\n\n      - run: |\n          git config --global user.email \"network-overrides+v0@example.com\"\n          git config --global user.name \"network-overrides-bot\"\n\n      # setup project\n      # install deps\n      # create the \"build\" folder\n\n      # and then:\n\n      - uses: kiprasmel/git-publish-generated-branch@v0\n        with:\n          ARGS: '--dir \"build\" --branch-prefix \"x-build/\"'\n\n```\n\n## Background\n\nthis tool works similarly to how github pages create another branch \"gh-pages\" and store static contents directly there, such that they're available on `\u003cusername\u003e.github.io/`.\n\nit was originally developed to help implement the following RFC:\n- https://github.com/miguel-silva/network-overrides/pull/5\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiprasmel%2Fgit-publish-generated-branch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiprasmel%2Fgit-publish-generated-branch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiprasmel%2Fgit-publish-generated-branch/lists"}