{"id":16916391,"url":"https://github.com/shaman123/gha-form-dropdown-options","last_synced_at":"2025-07-12T16:34:07.848Z","repository":{"id":60286851,"uuid":"542111167","full_name":"ShaMan123/gha-form-dropdown-options","owner":"ShaMan123","description":"A github action populating options for an issue forms dropdown.","archived":false,"fork":false,"pushed_at":"2025-07-12T01:49:52.000Z","size":849,"stargazers_count":5,"open_issues_count":1,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-12T03:45:11.230Z","etag":null,"topics":["dropdown","github-actions","issue-forms","issue-template","options","yaml"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ShaMan123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["ShaMan123"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-09-27T13:53:31.000Z","updated_at":"2025-07-12T01:49:55.000Z","dependencies_parsed_at":"2023-09-24T01:48:25.044Z","dependency_job_id":"4d74f616-68d5-4bca-8fcd-f4c358c7f469","html_url":"https://github.com/ShaMan123/gha-form-dropdown-options","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/ShaMan123/gha-form-dropdown-options","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShaMan123%2Fgha-form-dropdown-options","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShaMan123%2Fgha-form-dropdown-options/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShaMan123%2Fgha-form-dropdown-options/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShaMan123%2Fgha-form-dropdown-options/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShaMan123","download_url":"https://codeload.github.com/ShaMan123/gha-form-dropdown-options/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShaMan123%2Fgha-form-dropdown-options/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265024115,"owners_count":23699586,"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":["dropdown","github-actions","issue-forms","issue-template","options","yaml"],"created_at":"2024-10-13T19:26:59.929Z","updated_at":"2025-07-12T16:34:07.805Z","avatar_url":"https://github.com/ShaMan123.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ShaMan123"],"categories":[],"sub_categories":[],"readme":"# Issue Forms Dropdown Options\n\n[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Dropdown%20Options-blue.svg?colorA=24292e\u0026colorB=0366d6\u0026style=flat\u0026longCache=true\u0026logo=github)](https://github.com/marketplace/actions/issue-forms-dropdown-options)\n[![Sponsor ShaMan123](https://img.shields.io/badge/Sponsor%20%E2%9D%A4%20-ShaMan123-%E2%9D%A4?logo=GitHub\u0026color=%23fe8e86)](https://github.com/sponsors/ShaMan123)\n\n[![🧪 Test](https://github.com/ShaMan123/gha-form-dropdown-options/actions/workflows/test.yml/badge.svg)](https://github.com/ShaMan123/gha-form-dropdown-options/actions/workflows/test.yml)\n[![🚀 Update Bug Report](https://github.com/ShaMan123/gha-form-dropdown-options/actions/workflows/update_bug_report.yml/badge.svg)](https://github.com/ShaMan123/gha-form-dropdown-options/actions/workflows/update_bug_report.yml)\n\nA github action populating options for an [issue forms](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms) dropdown.\n\n## Looking for a _Version_ dropdown?\n\nCheckout [![issue-forms-version-dropdown](https://img.shields.io/github/v/tag/ShaMan123/gha-populate-form-version?label=ShaMan123%2Fgha-populate-form-version%40\u0026sort=semver)](https://github.com/marketplace/actions/issue-forms-version-dropdown)\n\n## Configuring\n\n- Follow [this workflow](.github/workflows/update_bug_report.yml).\n- Replace the `uses: ./` directive to point to [![published action](https://img.shields.io/github/v/tag/ShaMan123/gha-form-dropdown-options?label=ShaMan123%2Fgha-form-dropdown-options%40\u0026sort=semver)](https://github.com/marketplace/actions/issue-forms-dropdown-options).\n- Refer to the `inputs` and `outputs` definitions in the [spec](action.yml).\n\n## Live 🚀\n\nThis repo uses the action it defines.\n\n- Take a look at the dropdowns populated into the [issue template](../../issues/new?template=bug_report.yml) using [this workflow](.github/workflows/update_bug_report.yml).\n- Take a closer look at the [template file](./.github/template_report.yml) used to generate [`long_report.yml`](./.github/ISSUE_TEMPLATE/long_report.yml), see [Templates](#templates).\n- Don't forget to checkout [#5](../../pull/5). Refer to [Creating a PR](#creating-a-pr) for more information.\n- And you can view the [bot](../../commits?author=github-actions%5Bbot%5D) in action.\n\n## Advanced Usage\n\n### Templates\n\nThe `template` option introduces a _build_ step, sort of speaking.\nIt reads the `template` and outputs a generated file using `inputs.form`.\nThis means that you shouldn't edit the built form, as you wouldn't edit a build file.\n\nThe action will use `template` to build the form as follows:\n\n- Parse `template`\n- For each dropdown:\n  - Determine if dropdown is static using `inputs.strategy`.\n  - Static dropdowns (dropdowns with populated options in the template) take precedence over their built counterpart.\\\n    See an example [commit](https://github.com/ShaMan123/gha-form-dropdown-options/pull/2/commits/7cbd904caccb60c9bf52f066d11b303e439fe598).\n  - Dynamic dropdowns are persisted from the built file in order to enable updating parts of a form from multiple runs.\n- Set `inputs.options`\n- Write `form`\n\nUsing a `template` is **suggested** for the following:\n\n- Preserving comments: Parsing the yaml file will loose all comments\n- DX: Maintaining forms with long dropdown options\n- [Dynamic Substitution](#dynamic-substitution)\n\n### Dynamic Substitution\n\n- `{...}` : will populate the value from `template` if existing\n- `{{...}}` : will populate the previous value from `form` if existing.\n\n\u003cdetails\u003e\u003csummary\u003eDynamic Substitution Flow\u003c/summary\u003e\n\n**template.yml**\n\n```yaml template.yml\n    ...\n    - type: dropdown\n      id: _dropdown\n      description: 'template says: {...}, build says: ...'\n      options:\n        - a\n    ...\n```\n\n**workflow.yml**\n\n```yaml workflow.yml\n    ...\n    with:\n      id: _dropdown\n      description: 'template says: {...}, build says: ...'\n      options: {...}, b\n    ...\n```\n\n**build.yml #1**\n\n```yaml build.yml #1\n    ...\n    with:\n      id: _dropdown\n      description: 'template says: template says: {...}, build says: ..., build says: ...'\n      options:\n        - a\n        - b\n    ...\n```\n\n**workflow.yml**\n\n```yaml workflow.yml\n    ...\n    with:\n      id: _dropdown\n      description: 'template says: {{...}}, build says: ...'\n      options: {{...}}, c\n    ...\n```\n\n**build.yml #2**\n\n```yaml build.yml #2\n    ...\n    with:\n      id: _dropdown\n      description: 'template says: template says: template says: {...}, build says: ..., build says: ..., build says: ...'\n      options:\n        - a\n        - b\n        - c\n    ...\n```\n\n**workflow.yml**\n\n```yaml workflow.yml\n    ...\n    with:\n      id: _dropdown\n      description: 'template says: {{...}} but build says: ...'\n      options: {...}, d\n    ...\n```\n\n**build.yml #3**\n\n```yaml build.yml #3\n    ...\n    with:\n      id: _dropdown\n      description: 'template says: template says: template says: template says: {...}, build says: ..., build says: ..., build says: ... but build says: ...'\n      options:\n        - a\n        - d\n    ...\n```\n\n\u003c/details\u003e\n\nTake a look at the [template file](./.github/template_report.yml) used to generate the [built file](./.github/ISSUE_TEMPLATE/long_report.yml) for a live example.\n\n### Conflicting Runs\n\nSince workflows run in concurrency you may encounter a case in which a number of runs are trying to modify and commit the same file.\\\nThis might result in a merge conflict.\\\nIf that is the case the action will fail.\n\n_Consider the following:_\\\nThe labels of this repo are populated into a dropdown (see [Live](#live)).\\\nModifying a label more than once in a short period of time (before the previous runs completed) will fail to update the form.\n\nConsider handling failures in a consequent step or use the `dry_run` option to prevent the action from trying to commit in the first place and handle that yourself.\n\n### Creating a PR\n\nConsider using [![create-pull-request](https://img.shields.io/github/v/release/peter-evans/create-pull-request?label=peter-evans%2Fcreate-pull-request\u0026sort=semver)](https://github.com/marketplace/actions/create-pull-request) in order to commit changes in an orderly and safe fashion to a generated PR.\n\nRefer to the `update-long-report` job in [this workflow](.github/workflows/update_bug_report.yml) to see a usage example and to [PR #5](../../pull/5).\\\nDon't forget to use the `dry_run` option.\n\n## Developing\n\n```bash\nnpm i\nnpm start\nnpm test\n```\n\n## Release\n\nCreate a release after bumping a version and committing it:\n\n```\nnpm version \u003cmajor/minor/patch\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaman123%2Fgha-form-dropdown-options","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaman123%2Fgha-form-dropdown-options","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaman123%2Fgha-form-dropdown-options/lists"}