{"id":17001605,"url":"https://github.com/shresht7/action-metadata","last_synced_at":"2026-02-14T19:31:33.961Z","repository":{"id":36961094,"uuid":"470883063","full_name":"Shresht7/action-metadata","owner":"Shresht7","description":"A GitHub Action to expose action metadata of a GitHub Action! 📋","archived":false,"fork":false,"pushed_at":"2024-12-01T07:44:00.000Z","size":286,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T17:37:19.982Z","etag":null,"topics":["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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-17T07:03:21.000Z","updated_at":"2022-03-18T21:36:07.000Z","dependencies_parsed_at":"2024-10-28T14:03:27.087Z","dependency_job_id":"fa3e7a43-0cc4-4e97-958e-18c1e397338f","html_url":"https://github.com/Shresht7/action-metadata","commit_stats":{"total_commits":111,"total_committers":4,"mean_commits":27.75,"dds":"0.39639639639639634","last_synced_commit":"c0311c3ec2e8fdb3f09fee30c88b6579d6b23fba"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2Faction-metadata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2Faction-metadata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2Faction-metadata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2Faction-metadata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shresht7","download_url":"https://codeload.github.com/Shresht7/action-metadata/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244231478,"owners_count":20419958,"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":["github-actions"],"created_at":"2024-10-14T04:25:29.578Z","updated_at":"2026-02-14T19:31:33.922Z","avatar_url":"https://github.com/Shresht7.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align='center'\u003e\n  Action Metadata\n\u003c/h1\u003e\n\n\u003cdiv align='center'\u003e\n\n[![Release](https://img.shields.io/github/v/release/Shresht7/action-metadata?style=for-the-badge)](https://github.com/Shresht7/action-metadata/releases)\n[![License](https://img.shields.io/github/license/Shresht7/action-metadata?style=for-the-badge)](./LICENSE)\n\n\u003c/div\u003e\n\n\u003cp align='center'\u003e\n\u003c!-- slot: description --\u003e\nA GitHub Action to expose action metadata of a GitHub Action!\n\u003c!-- /slot --\u003e\n\u003c/p\u003e\n\n\u003cdiv align='center'\u003e\n\n[![Test](https://github.com/Shresht7/action-metadata/actions/workflows/test.yml/badge.svg)](https://github.com/Shresht7/action-metadata/actions/workflows/test.yml)\n[![Validate](https://github.com/Shresht7/action-metadata/actions/workflows/validate.yml/badge.svg)](https://github.com/Shresht7/action-metadata/actions/workflows/validate.yml)\n[![Action Readme](https://github.com/Shresht7/action-metadata/actions/workflows/action-readme.yml/badge.svg)](https://github.com/Shresht7/action-metadata/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- [📖 Usage](#-usage)\n- [📋 Inputs](#-inputs)\n- [📋 Outputs](#-outputs)\n- [📃 Workflow Example](#-workflow-example)\n- [📑 License](#-license)\n\n\u003c/details\u003e\n\n\n---\n\n## 📖 Usage\n\nUse this action as a step in a workflow job and give it an `id` (`action-metadata` in the following examples).\n\n```yaml\n- name: action-metadata               # Name of the workflow step\n  id: action-metadata                 # Give this step an id to reference it later for outputs\n  uses: Shresht7/action-metadata@v1   # Use this action\n```\n\nThe action will expose the [metadata][1] as an `output` which you can reference in subsequent steps using an [expression][2] `${{ steps.\u003cgiven_id\u003e.outputs.\u003coutput\u003e }}`.\nFor a list of all available outputs see [Outputs](#outputs).\n\n\n```yaml\n- name: some-other-action           \n  uses: user/some-other-action@v1     # Not a real user and/or action\n  with:\n    description: ${{ steps.action-metadata.outputs.description }}\n    inputs: ${{ steps.action-metadata.outputs.inputs-md-table }}\n```\n\nThe entire [metadata][1] object is available as a stringified JSON (i.e. `string`) as the `metadata` output. You will need to parse this string to use it as an object using [`fromJSON`][3] in an [expression][2] or `JSON.parse` in your action.\n\n```yaml\n- name: some-other-action\n  uses: user/some-other-action@v1     # Not a real user and/or action\n  with:\n    # Use the fromJSON function in the expression to parse metadata as JSON\n    name: ${{ fromJSON(steps.action-metadata.outputs.metadata).author }}\n```\n\n## 📋 Inputs\n\nThe action can run on auto-pilot using the default parameters. To change any inputs, pass them along the workflow step.\n\n```yaml\n- name: action-metadata\n  id: action-metadata\n  uses: Shresht7/action-metadata@v1\n  with:\n    input-table-alignment: 'c,l,r,l'\n```\n\n\u003c!-- slot: inputs --\u003e\n| Input                    | Description                                                                                           |   Default | Required |\n| :----------------------- | :---------------------------------------------------------------------------------------------------- | --------: | :------: |\n| `input-table-alignment`  | Comma-separated array denoting the alignment of columns ['l' for left, 'c' for center, 'r' for right] | `l,l,r,c` |          |\n| `output-table-alignment` | Comma-separated array denoting the alignment of columns ['l' for left, 'c' for center, 'r' for right] | `l,l,r,c` |          |\n\u003c!-- /slot --\u003e\n\n## 📋 Outputs\n\nThe action exposes the entire metadata yaml (`metadata`) as a stringified JSON. To make the most of this output you will need to parse it using [`fromJSON`][3] or `JSON.parse` functions.\n\nThe `name`, `author` and `description` fields, in addition to being available through the parsed `metadata`, are also exposed on their own.\n\nThis action also exposes markdown-tables for the `input` and `output` parameters specified in the metadata file. This was the primary motivation for this action.\n\n\u003c!-- slot: outputs --\u003e\n| Output             | Description                                                        |\n| :----------------- | :----------------------------------------------------------------- |\n| `metadata`         | stringified JSON representation of the entire action metadata file |\n| `name`             | Name of the GitHub Action                                          |\n| `author`           | Name of the action's author                                        |\n| `description`      | A short description of the action                                  |\n| `inputs-md-table`  | Markdown table of the action inputs                                |\n| `outputs-md-table` | Markdown table of the action outputs                               |\n\u003c!-- /slot --\u003e\n\n## 📃 Workflow Example\n\nThe [Inputs](#inputs) and [Outputs](#outputs) tables you see in this readme were generated using this action in conjunction with [markdown-slots][4]. To see the complete workflow, see [action-readme.yml][5].\n\n[![Action Readme](https://github.com/Shresht7/action-metadata/actions/workflows/action-readme.yml/badge.svg)](https://github.com/Shresht7/action-metadata/actions/workflows/action-readme.yml)\n\n\u003cdetails\u003e\n\n\u003csummary\u003eor click here\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n\u003c!-- slot: action-readme-workflow,  prepend: ```yaml, append: ``` --\u003e\n```yaml\n# =============\n# ACTION README\n# =============\n\nname: Action Readme\n\n# Activation Events\n# =================\n\non:\n  # When the action.yml or this workflow file changes on the main branch\n  push:\n    branches:\n      - main\n    paths:\n      - action.yml\n      - .github/workflows/action-readme.yml\n\n  # Manual workflow dispatch\n  workflow_dispatch:\n\n# Jobs\n# ====\n\njobs:\n  update-readme:\n    runs-on: ubuntu-latest\n    steps:\n      # Checkout Repository ✅\n      # ======================\n\n      - name: checkout\n        uses: actions/checkout@v3\n\n      # Retrieve Action Metadata 📜\n      # ===========================\n\n      - name: get action metadata\n        id: action-metadata\n        uses: Shresht7/action-metadata@v1\n\n      # Read this Workflow File 📄\n      # ==========================\n\n      - name: read workflow file\n        id: read-file\n        uses: Shresht7/read-file-action@v1\n        with:\n          path: .github/workflows/action-readme.yml\n\n      # Markdown Slots 📋\n      # =================\n\n      - name: update readme slots\n        id: markdown-slots\n        uses: Shresht7/markdown-slots@v1\n        with:\n          slots: |\n            - slot: description\n              content: ${{ steps.action-metadata.outputs.description }}\n            - slot: inputs\n              content: ${{ steps.action-metadata.outputs.inputs-md-table }}\n            - slot: outputs\n              content: ${{ steps.action-metadata.outputs.outputs-md-table }}\n            - slot: action-readme-workflow\n              content: ${{ toJSON(steps.read-file.outputs.contents) }}\n\n      # Push Changes 🌎\n      # ===============\n\n      - name: check for changes\n        id: git-diff\n        run: |\n          if git diff --exit-code; then\n            echo \"::set-output name=changes_exist::false\"\n          else\n            echo \"::set-output name=changes_exist::true\"\n          fi\n\n      - name: commit and push\n        if: ${{ steps.git-diff.outputs.changes_exist == 'true' }}\n        run: |\n          git config user.name 'github-actions[bot]'\n          git config user.email 'github-actions[bot]@users.noreply.github.com'\n          git add .\n          git commit -m 'Update README.md 📄'\n          git push\n\n```\n\u003c!-- /slot --\u003e\n\n\u003c/details\u003e\n\n---\n\n## 📑 License\n\u003e [MIT License](./LICENSE)\n\n\u003c!-- LINKS --\u003e\n[1]: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions\n[2]: https://docs.github.com/en/actions/learn-github-actions/expressions\n[3]: https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson\n[4]: https://www.github.com/Shresht7/markdown-slots\n[5]: .github/workflows/action-readme.yml","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshresht7%2Faction-metadata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshresht7%2Faction-metadata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshresht7%2Faction-metadata/lists"}