{"id":19563049,"url":"https://github.com/knowledge-work/command-action","last_synced_at":"2026-01-24T07:32:47.262Z","repository":{"id":254968865,"uuid":"848026684","full_name":"knowledge-work/command-action","owner":"knowledge-work","description":"🔧 IssueOps commands in GitHub Actions.","archived":false,"fork":false,"pushed_at":"2026-01-20T18:15:25.000Z","size":895,"stargazers_count":6,"open_issues_count":42,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-01-20T19:12:36.162Z","etag":null,"topics":["github-actions","issueops"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knowledge-work.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-27T01:58:02.000Z","updated_at":"2025-10-14T19:55:54.000Z","dependencies_parsed_at":"2024-08-27T08:30:05.541Z","dependency_job_id":"b0e1a47b-b4e0-4516-8336-ae0d01cd244d","html_url":"https://github.com/knowledge-work/command-action","commit_stats":null,"previous_names":["knowledge-work/command-action"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/knowledge-work/command-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowledge-work%2Fcommand-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowledge-work%2Fcommand-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowledge-work%2Fcommand-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowledge-work%2Fcommand-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knowledge-work","download_url":"https://codeload.github.com/knowledge-work/command-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowledge-work%2Fcommand-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28718960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T05:53:42.649Z","status":"ssl_error","status_checked_at":"2026-01-24T05:53:41.698Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["github-actions","issueops"],"created_at":"2024-11-11T05:16:27.373Z","updated_at":"2026-01-24T07:32:47.256Z","avatar_url":"https://github.com/knowledge-work.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n\n# :wrench: IssueOps Command Action\n\n\u003c!-- gha-description-start --\u003e\n\nIssueOps commands in GitHub Actions.\n\n\u003c!-- gha-description-end --\u003e\n\n[![Build][badge-build]][build]\n[![Apache-2.0][badge-license]][license]\n[![code style: prettier][badge-prettier]][prettier]\n[![semantic-release: angular][badge-semantic-release]][semantic-release]\n\n\u003c/div\u003e\n\n`knowledge-work/command-action` is an Action inspired by [github/command](https://github.com/github/command/).\n\nIt provides primitive features to assist in implementing IssueOps commands. It parses key-value strings using a dedicated syntax and converts them into a format that can be used in subsequent workflows. These will help in implementing high-level IssueOps commands.\n\n\u003e [!note]\n\u003e Currently, a syntax that supports receiving multiple parameters is provided.\n\n## :zap: Getting Started\n\nThis section introduces a quick start guide for `knowledge-work/command-action`.\n\n### Usage\n\nSpecify the command name to be executed as IssueOps in the `command` option.\n\n```yaml\n- id: command\n  uses: knowledge-work/command-action@v1\n  with:\n    command: 'preview'\n```\n\nThis sets up your custom IssueOps command to interpret comments on Issues and Pull Requests.\n\nRefer to [Inputs](#inbox_tray-inputs) for other options.\n\n### Example\n\nHere’s a simple workflow example to execute the `.greet` command in IssueOps.\n\n```yaml\nname: 'Greet DEMO'\n\non:\n  issue_comment:\n    types: [created]\n\njobs:\n  demo:\n    runs-on: ubuntu-latest\n    steps:\n      # Set up the \".greet\" command.\n      - id: command\n        uses: knowledge-work/command-action@v1\n        with:\n          command: 'greet'\n\n      # Only run if `steps.\u003cid\u003e.outputs.continue` is \"true\".\n      # This indicates that `knowledge-work` successfully parsed the command and the subsequent steps should continue.\n      - name: Greet\n        if: ${{ steps.command.outputs.continue == 'true' }}\n        run: echo \"Hi ${{ fromJSON(steps.command.outputs.params).name }} !\"\n\n      # Add other steps necessary for IssueOps...\n```\n\nYou can invoke the `.greet` command as follows:\n\n```\n.greet name=\"Alice\"\n```\n\nRefer to [IssueOps Command Syntax](#book-issueops-command-syntax) for more detailed syntax.\n\n## :book: IssueOps Command Syntax\n\nWhen executing an IssueOps command, it often needs to accept some parameters. This Action parses the parameters using a simple key-value syntax, allowing you to quickly build the scaffolding required for more complex IssueOps commands.\n\n### Overview\n\nAn IssueOps command is called in the following format:\n\n```\n.\u003ccommand\u003e \u003ckey\u003e=\u003cvalue\u003e, \u003ckey\u003e=\u003cvalue\u003e, ...\n```\n\n`\u003ckey\u003e` should consist of the following:\n\n- A string starting with alphanumeric characters or an underscore.\n- A string followed by alphanumeric characters, underscores, or hyphens.\n\nThe key-value parameters provided are converted into JSON format and made available as `outputs.params`. For example, if the following command is executed:\n\n```\n.greet name=\"Alice\", age=20\n```\n\nYou will get the following `outputs.params`:\n\n```json\n{\n  \"name\": \"Alice\",\n  \"age\": 20\n}\n```\n\n### Values\n\nValues that can be specified for parameters include numbers, strings, booleans, and null. Below are examples of each. Refer to [`parse.test.ts`](./src/parse.test.ts) for more detailed specifications.\n\n#### Numbers\n\nSupports common signed and unsigned integers as well as decimals.\n\n```\n.command key=123\n.command key=+456\n.command key=-789\n.command key=0.5\n```\n\n#### Strings\n\nStrings can use single or double quotes. Escaping is also supported.\n\n```\n.command key='value'\n.command key=\"value\"\n\n.command key='value \\' with escape'\n.command key=\"value \\\" with escape\"\n```\n\nQuotes can also be omitted if the string does not contain spaces or commas.\n\n```\n.command key=/path/to/file.txt\n```\n\n#### Booleans\n\nSupports booleans in JSON format.\n\n```\n.command key=true\n.command key=false\n```\n\n#### null\n\nSupports null in JSON format.\n\n```\n.command key=null\n```\n\n## :inbox_tray: Inputs\n\n\u003c!-- gha-inputs-start --\u003e\n\n| ID                 | Required           | Default              | Description                                                                                       |\n| :----------------- | :----------------- | :------------------- | :------------------------------------------------------------------------------------------------ |\n| `command`          | :white_check_mark: | n/a                  | The name of the command to be used in IssueOps, which can be specified as a comma-separated list. |\n| `allowed_contexts` |                    | `issue,pull_request` | The comment contexts that trigger the IssueOps command, specified as a comma-separated list.      |\n\n\u003c!-- gha-inputs-end --\u003e\n\n## :outbox_tray: Outputs\n\n\u003c!-- gha-outputs-start --\u003e\n\n| ID             | Description                                                                                                                                                                          |\n| :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `continue`     | Indicates whether the IssueOps command was triggered and the workflow should continue with the string `\"true\"`. If the action did not complete successfully, `\"false\"` will be used. |\n| `params`       | The parameters of the triggered IssueOps command, provided as a JSON string.                                                                                                         |\n| `comment_id`   | The ID of the comment that triggered this action.                                                                                                                                    |\n| `actor`        | The GitHub handle of the actor who executed the IssueOps command.                                                                                                                    |\n| `issue_number` | The issue number of the comment that triggered this action.                                                                                                                          |\n| `command`      | The command of the triggered IssueOps command.                                                                                                                                       |\n\n\u003c!-- gha-outputs-end --\u003e\n\n## :bulb: TIPS\n\nA section introducing tips for implementing IssueOps commands.\n\n### Reacting to the comment\n\nYou can use [actions/github-script](https://github.com/actions/github-script) to add a reaction to the comment that triggered the IssueOps command.\n\n```yaml\njobs:\n  demo:\n    runs-on: ubuntu-latest\n    steps:\n      - id: command\n        uses: knowledge-work/command-action@v1\n        with:\n          command: 'greet'\n\n      # A snippet to add a reaction to the comment that triggered the command.\n      - if: ${{ steps.command.outputs.continue == 'true' }}\n        name: Reactions\n        uses: actions/github-script@v7\n        with:\n          script: |\n            await github.rest.reactions.createForIssueComment({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              comment_id: context.payload.comment.id,\n              content: 'eyes',\n            });\n\n      # Add other steps necessary for IssueOps...\n```\n\nPlease note that this action does not provide a reaction feature. However, by leveraging GitHub Action's awesome ecosystem, you can implement highly flexible IssueOps commands.\n\n## :paw_prints: Development\n\nIntroducing the steps for developing `command-action`.\n\n### Setup\n\nUsing a Node.js Version Manager such as `asdf` or `nodenv`, activate the version of Node.js written in `.node-version`.\n\nNext, activate `pnpm` using `corepack`, and install the dependent packages.\n\n```bash\n$ corepack enable pnpm\n$ pnpm i\n```\n\n## LICENSE\n\nSee [LICENSE][license].\n\nCopyright 2024 Knowledge Work Inc.\n\n[badge-build]: https://img.shields.io/github/actions/workflow/status/knowledge-work/command-action/ci.yaml?style=flat-square\n[badge-license]: https://img.shields.io/github/license/knowledge-work/command-action?style=flat-square\n[badge-prettier]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square\n[badge-semantic-release]: https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release\u0026style=flat-square\n[build]: https://github.com/knowledge-work/command-action/actions/workflows/ci.yaml\n[license]: ./LICENSE\n[prettier]: https://github.com/prettier/prettier\n[semantic-release]: https://github.com/semantic-release/semantic-release\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknowledge-work%2Fcommand-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknowledge-work%2Fcommand-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknowledge-work%2Fcommand-action/lists"}