{"id":17001610,"url":"https://github.com/shresht7/gist-mirror","last_synced_at":"2026-01-30T01:13:34.495Z","repository":{"id":37934842,"uuid":"456878328","full_name":"Shresht7/Gist-Mirror","owner":"Shresht7","description":"GitHub Action to mirror files from your repository to GitHub Gists 📄","archived":false,"fork":false,"pushed_at":"2024-12-01T21:29:00.000Z","size":621,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T15:58:46.118Z","etag":null,"topics":["gists","github-actions"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shresht7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-08T10:08:04.000Z","updated_at":"2022-03-25T13:33:40.000Z","dependencies_parsed_at":"2023-02-17T11:00:27.970Z","dependency_job_id":null,"html_url":"https://github.com/Shresht7/Gist-Mirror","commit_stats":{"total_commits":177,"total_committers":4,"mean_commits":44.25,"dds":"0.25988700564971756","last_synced_commit":"ee12d3a96bc9128a3fea39821621551dfe661d10"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2FGist-Mirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2FGist-Mirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2FGist-Mirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2FGist-Mirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shresht7","download_url":"https://codeload.github.com/Shresht7/Gist-Mirror/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525770,"owners_count":21118749,"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":["gists","github-actions"],"created_at":"2024-10-14T04:25:32.104Z","updated_at":"2026-01-30T01:13:34.463Z","avatar_url":"https://github.com/Shresht7.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align='center'\u003e\n  Gist-Mirror\n\u003c/h1\u003e\n\n\n\u003cdiv align='center'\u003e\n\n[![Release](https://img.shields.io/github/v/release/Shresht7/Gist-Mirror?style=for-the-badge)](https://github.com/Shresht7/Gist-Mirror/releases)\n[![License](https://img.shields.io/github/license/Shresht7/Gist-Mirror?style=for-the-badge)](./LICENSE)\n\n\u003c/div\u003e\n\n\u003cp align='center'\u003e\n  \u003c!-- slot: description  --\u003e\nMirror files from your repository to GitHub Gists\n\u003c!-- /slot --\u003e\n\u003c/p\u003e\n\n\u003cdiv align='center'\u003e\n\n[![Test](https://github.com/Shresht7/Gist-Mirror/actions/workflows/test.yml/badge.svg)](https://github.com/Shresht7/Gist-Mirror/actions/workflows/test.yml)\n[![Validate](https://github.com/Shresht7/Gist-Mirror/actions/workflows/validate.yml/badge.svg)](https://github.com/Shresht7/Gist-Mirror/actions/workflows/validate.yml)\n[![Gist-Mirror](https://github.com/Shresht7/Gist-Mirror/actions/workflows/gist-mirror.yml/badge.svg)](https://github.com/Shresht7/Gist-Mirror/actions/workflows/gist-mirror.yml)\n[![Action Readme](https://github.com/Shresht7/Gist-Mirror/actions/workflows/action-readme.yml/badge.svg)](https://github.com/Shresht7/Gist-Mirror/actions/workflows/action-readme.yml)\n\n\u003c/div\u003e\n\n\u003cdetails\u003e\n\n\u003csummary align='center'\u003eTable of Contents\u003c/summary\u003e\n\n- [📑 Permissions](#-permissions)\n- [📖 Usage](#-usage)\n  - [Workflow Setup](#workflow-setup)\n    - [1. Gist Token](#1-gist-token)\n    - [2. Gist](#2-gist)\n    - [3. Workflow](#3-workflow)\n  - [On Push Trigger](#on-push-trigger)\n- [📋 Inputs](#-inputs)\n  - [gists](#gists)\n  - [dry-run](#dry-run)\n- [📃 Workflow Example](#-workflow-example)\n- [📑 License](#-license)\n\n\u003c/details\u003e\n\n-------------\n\n## 📑 Permissions\n\nThis action needs a [**personal access token**](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) (with the _gist_ permission) in order to update gists.\n\n\n## 📖 Usage\n\n### Workflow Setup\n\n#### 1. Gist Token\n\nThe `GITHUB_TOKEN` that comes with GitHub Actions by default, is restricted to the local repository. In other words, it _does not_ have permission to access GitHub Gists. You will have to provide a [**personal access token**](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) (with the `gist` permission) as a secret.\n\n1. Get a [personal-access-token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).\n1. Add it to your [repository secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) in the repo settings.\n2. When you create the [workflow](#workflow), pass the secret in as the `GIST_TOKEN` environment variable.\n\n```yaml\n    env:\n      GIST_TOKEN: ${{ secret.[SECRET_NAME] }}\n```\n\n#### 2. Gist\n\nNote the `ID` of the gist you want to target. Create an new [Gist](https://gist.github.com/) if required.\n\n\u003e The `ID` is visible in the gist's url. `https://gist.github.com/\u003cuser\u003e/\u003cID\u003e`\n\nThe workflow takes a YAML input mapping gist-IDs to their corresponding files. e.g. to upload `README.md` to a gist with id `xyz123` you will provide the following input.\n\n```yaml\nwith:\n  gists: |\n    - id: xyz123\n      description: A test gist\n      files:\n        - README.md\n```\n\n\u003e Note the `|`. It signifies that the input is a multiline string and not part of the workflow yaml.\n\n#### 3. Workflow\n\nUse this action in a workflow.\n\n```yaml\n- name: Gist-Mirror\n  id: Gist-Mirror\n  uses: Shresht7/Gist-Mirror@v1\n  env:\n    GIST_TOKEN: ${{ secrets.GIST_TOKEN }}\n  with:\n    gists: |\n      - id: bed31c34989a8ee63ec0dc4981a74c9c\n        description: Gist-Mirror Action\n        files:\n          - README.md\n          - .github/workflows/gist-mirror.yml\n```\n\n### On Push Trigger\n\nYou can use the on-push events to run the workflow automatically whenever commits are pushed to the remote repository.\n\nTrigger when commits are pushed to the main branch\n\n```yaml\non:\n  push:\n    branches:\n      - main\n```\n\nor when commits affect certain files\n\n```yaml\n  on:\n    push:\n      paths:\n        - README.md\n        - httpStatusCodes.ts\n```\n\nRead more about [events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows)\n\nYou can use these event triggers to run the workflow automatically whenever a file (that is to be mirrored to a gist) is changed.\n\nTo see a working example, see [Workflow Example](#-workflow-examples).\n\n## 📋 Inputs\n\n\u003c!-- slot: inputs  --\u003e\n| Input     | Description                                          |     Default | Required |\n| :-------- | :--------------------------------------------------- | ----------: | :------: |\n| `gists`   | YAML mapping Gist IDs to their corresponding files   | `undefined` |    ✅     |\n| `dry-run` | No actual changes will be made if dry-run is enabled |     `false` |          |\n\u003c!-- /slot --\u003e\n\n### gists\n\nThe `gists` input takes in a YAML configuration mapping gist-ID to their corresponding files. You can specify multiple gist-IDs and multiple files.\n\n```yaml\n- id: gist_id_1\n  description: single file gist\n  files:\n    - README.md\n\n- id: gist_id_2\n  files:\n    - package.json\n    - package-lock.json\n    - .gitignore\n```\n\n### dry-run\n\nIf set to `true`, the action will not make any real changes and will only output logs.\n\n## 📃 Workflow Example\n\nTo see a working example of this action, see this [workflow](./.github/workflows/gist-mirror.yml). This is the generated [Gist](https://gist.github.com/Shresht7/bed31c34989a8ee63ec0dc4981a74c9a).\n\n[![Gist-Mirror](https://github.com/Shresht7/Gist-Mirror/actions/workflows/gist-mirror.yml/badge.svg)](https://github.com/Shresht7/Gist-Mirror/actions/workflows/gist-mirror.yml)\n\n\u003cdetails\u003e\n\n  \u003csummary\u003e\n    click here to show the workflow\n  \u003c/summary\u003e\n\n  \u003cbr /\u003e\n\n\u003c!-- slot: workflow-example, prepend ```yaml, append: ``` --\u003e\n```yaml\n# ===========================================\n#                 GIST-MIRROR\n# -------------------------------------------\n# Mirror files from your repo to GitHub Gists\n# ===========================================\n\nname: Gist-Mirror\n\n# Activation Events\n# =================\n\non:\n  push:\n    paths:\n      # Whenever a commit that affects the given files is pushed\n      - README.md\n      - ./github/workflows/gist-mirror.yml\n\n  workflow_dispatch: # When a workflow event is dispatched manually\n    inputs:\n      dry-run:\n        description: Dry-Run Switch\n        default: \"false\"\n        required: false\n\n# Jobs\n# ====\n\njobs:\n  Gist-Mirror:\n    runs-on: ubuntu-latest\n\n    name: Gist-Mirror\n    steps:\n      # Actions/Checkout\n      # ================\n\n      # Required for GITHUB_WORKSPACE\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      # Execute Gist-Mirror Action\n      # ==========================\n\n      - name: Gist-Mirror\n        uses: Shresht7/Gist-Mirror@v1\n        id: Gist-Mirror\n\n        # Config Parameters\n        # -----------------\n\n        with:\n          dry-run: ${{ github.event.inputs.dry-run == 'true' }}\n          gists: |\n            - id: bed31c34989a8ee63ec0dc4981a74c9a\n              description: Gist-Mirror Action\n              files:\n                - README.md\n                - .github/workflows/gist-mirror.yml\n\n        # Environment Variables\n        # ---------------------\n\n        env:\n          GIST_TOKEN: ${{ secrets.GIST_TOKEN }} # Personal-Access-Token with gist permissions.\n\n```\n\u003c!-- /slot --\u003e\n\n\u003c/details\u003e\n\n---\n\n## 📑 License\n\n\u003e [MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshresht7%2Fgist-mirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshresht7%2Fgist-mirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshresht7%2Fgist-mirror/lists"}