{"id":22408994,"url":"https://github.com/bryant-finney/fix-pr-title","last_synced_at":"2026-05-18T04:05:14.361Z","repository":{"id":262153855,"uuid":"885636629","full_name":"bryant-finney/fix-pr-title","owner":"bryant-finney","description":"Ensure PR titles include well-formatted Jira issue keys","archived":false,"fork":false,"pushed_at":"2025-02-24T14:49:11.000Z","size":11916,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T02:21:21.682Z","etag":null,"topics":["actions","jira","pull-requests","typescript"],"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/bryant-finney.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":"2024-11-09T02:01:34.000Z","updated_at":"2024-11-28T18:57:05.000Z","dependencies_parsed_at":"2024-11-24T21:22:14.836Z","dependency_job_id":"e23d7fcb-31c7-47ee-9a16-cd58428638f4","html_url":"https://github.com/bryant-finney/fix-pr-title","commit_stats":null,"previous_names":["bryant-finney/action-pr-titles","bryant-finney/action-fix-pr-title","bryant-finney/fix-pr-title"],"tags_count":0,"template":false,"template_full_name":"actions/typescript-action","purl":"pkg:github/bryant-finney/fix-pr-title","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryant-finney%2Ffix-pr-title","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryant-finney%2Ffix-pr-title/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryant-finney%2Ffix-pr-title/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryant-finney%2Ffix-pr-title/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bryant-finney","download_url":"https://codeload.github.com/bryant-finney/fix-pr-title/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryant-finney%2Ffix-pr-title/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002021,"owners_count":26083258,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["actions","jira","pull-requests","typescript"],"created_at":"2024-12-05T12:06:13.401Z","updated_at":"2025-10-09T20:18:16.121Z","avatar_url":"https://github.com/bryant-finney.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fix PR Title V1\n\n[![GitHub Super-Linter](https://github.com/bryant-finney/fix-pr-title/actions/workflows/linter.yml/badge.svg)](https://github.com/super-linter/super-linter)\n![CI](https://github.com/bryant-finney/fix-pr-title/actions/workflows/ci.yml/badge.svg)\n[![Check dist/](https://github.com/bryant-finney/fix-pr-title/actions/workflows/check-dist.yml/badge.svg)](https://github.com/actions/typescript-action/actions/workflows/check-dist.yml)\n[![CodeQL](https://github.com/bryant-finney/fix-pr-title/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/bryant-finney/fix-pr-title/actions/workflows/codeql-analysis.yml)\n[![Coverage](./badges/coverage.svg)](./badges/coverage.svg)\n\nThis action ensures PR titles include well-formatted Jira issue keys.\n\n\u003e _Created from the_ [`actions/typescript-action`] _template_\n\n[`actions/typescript-action`]: https://github.com/actions/typescript-action\n\n![demo.gif](./demo.gif)\n\n## Usage\n\nAn example of a minimal workflow is provided in\n[`.github/workflows/example.yml`](./.github/workflows/example.yml).\n\n1. Ensure the following permissions are set for the job:\n\n   ```yaml\n   permissions:\n     pull-requests: write\n   ```\n\n1. Add the following two steps to a job in your workflow:\n\n   ```yaml\n   - id: fix\n     uses: bryant-finney/fix-pr-title@v1\n     with:\n       # Check (and potentially fix) this string (required)\n       title: ${{ github.event.pull_request.title }}\n\n       # Specify which Jira issue prefixes to enforce (required)\n       prefixes: foo,bar,baz\n\n   # the second step only runs if the first step made changes\n   - if: ${{ steps.fix.outputs.fixed == 'true' }}\n\n     # store gh parameters in environment variables (for readability)\n     env:\n       FIXED: ${{ steps.fix.outputs.title }}\n       PR_NUM: ${{ github.event.number }}\n       REPO: ${{ github.repository }}\n\n       # used by gh to authenticate with the GitHub API\n       GH_TOKEN: ${{ github.token }}\n\n     # Apply the fix\n     run: gh pr edit \"$PR_NUM\" --title \"$FIXED\" --repo \"$REPO\"\n   ```\n\n### Inputs\n\nSee [`action.yml`](./action.yml).\n\n| Name       | Description                                                    | Required |\n| ---------- | -------------------------------------------------------------- | -------- |\n| `title`    | The PR title to check (and potentially fix)                    | Yes      |\n| `prefixes` | A comma-separated list of valid Jira issue prefixes to enforce | Yes      |\n\n### Outputs\n\n| Name    | Description                                                                   |\n| ------- | ----------------------------------------------------------------------------- |\n| `title` | The PR title after applying corrections (might not have changes)              |\n| `fixed` | A string indicating whether the title was fixed (`\"true\"`) or not (`\"false\"`) |\n\n## Contributing\n\n### Development Setup\n\n\u003e [!NOTE]\n\u003e\n\u003e You'll need to have a reasonably modern version of\n\u003e [Node.js](https://nodejs.org) handy (20.x or later should work!). If you are\n\u003e using a version manager like [`nodenv`](https://github.com/nodenv/nodenv) or\n\u003e [`nvm`](https://github.com/nvm-sh/nvm), this template has a `.node-version`\n\u003e file at the root of the repository that will be used to automatically switch\n\u003e to the correct version when you `cd` into the repository. Additionally, this\n\u003e `.node-version` file is used by GitHub Actions in any `actions/setup-node`\n\u003e actions.\n\nAfter you've cloned the repository to your local machine or codespace, perform\nsome initial setup steps:\n\n1. 🛠 Install the dependencies\n\n   ```bash\n   npm install\n   ```\n\n1. 🏗 Package the TypeScript for distribution\n\n   ```bash\n   npm run bundle\n   ```\n\n1. ✅ Run the tests\n\n   ```bash\n   $ npm test\n\n   PASS  ./index.test.js\n     ✓ throws invalid number (3ms)\n     ✓ wait 500 ms (504ms)\n     ✓ test runs (95ms)\n\n   ...\n   ```\n\n#### Visual Studio Code Setup\n\nA baseline configuration for Visual Studio Code is included in this repository;\nto use it:\n\n```sh\n# Copy the configuration file to the root of the repository\ncp .vscode/fix-pr-title.code-workspace fix-pr-title.code-workspace\n\n# Open the workspace in Visual Studio Code\ncode fix-pr-title.code-workspace\n```\n\n### How To\n\n#### Update the Action Metadata\n\nThe [`action.yml`](action.yml) file defines metadata about your action, such as\ninput(s) and output(s). For details about this file, see\n[Metadata syntax for GitHub Actions](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions).\n\nWhenever the API of this action is changed, the [`action.yml`](action.yml) needs\nto be updated accordingly.\n\n#### Update the Action Code\n\nThe [`src/`](./src/) directory is the heart of your action! This contains the\nsource code that will be run when your action is invoked. There are a few things\nto keep in mind when writing the action code:\n\n- Most GitHub Actions toolkit and CI/CD operations are processed asynchronously.\n  In `main.ts`, you will see that the action is run in an `async` function.\n\n  ```javascript\n  import * as core from '@actions/core'\n  //...\n\n  async function run() {\n    try {\n      //...\n    } catch (error) {\n      core.setFailed(error.message)\n    }\n  }\n  ```\n\n  For more information about the GitHub Actions toolkit, see the\n  [documentation](https://github.com/actions/toolkit/blob/master/README.md).\n\n1. Format the source code, execute tests, and build the `dist`\n\n   ```bash\n   npm run all\n   ```\n\n   \u003e This step is important! It will run [`ncc`](https://github.com/vercel/ncc)\n   \u003e to build the final JavaScript action code with all dependencies included.\n   \u003e If you do not run this step, your action will not work correctly when it is\n   \u003e used in a workflow. This step also includes the `--license` option for\n   \u003e `ncc`, which will create a license file for all of the production node\n   \u003e modules used in your project.\n\n1. Test the action out locally\n\n   The [`@github/local-action`](https://github.com/github/local-action) utility\n   can be used to test your action locally. It is a simple command-line tool\n   that \"stubs\" (or simulates) the GitHub Actions Toolkit. This way, you can run\n   your TypeScript action locally without having to commit and push your changes\n   to a repository.\n\n   The `local-action` utility can be run in the following ways:\n\n   - Visual Studio Code Debugger\n\n     Make sure to review and, if needed, update\n     [`.vscode/launch.json`](./.vscode/launch.json)\n\n   - Terminal/Command Prompt\n\n     ```bash\n     # npx local action \u003caction-yaml-path\u003e \u003centrypoint\u003e \u003cdotenv-file\u003e\n     npx local-action . src/main.ts .env\n     ```\n\n   You can provide a `.env` file to the `local-action` CLI to set environment\n   variables used by the GitHub Actions Toolkit. For example, setting inputs and\n   event payload data used by your action. For more information, see the example\n   file, [`.env.example`](./.env.example), and the\n   [GitHub Actions Documentation](https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables).\n\nFor information about versioning this action, see\n[Versioning](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)\nin the GitHub Actions toolkit.\n\n#### Validate the Action with CI\n\nThe action is referenced in a workflow file for testing; for details about this\ntest, see [`ci.yml`](./.github/workflows/ci.yml).\n\n#### Publish a New Release\n\nThis project includes a helper script, [`script/release`](./script/release)\ndesigned to streamline the process of tagging and pushing new releases for\nGitHub Actions.\n\nGitHub Actions allows users to select a specific version of the action to use,\nbased on release tags. This script simplifies this process by performing the\nfollowing steps:\n\n1. **Retrieving the latest release tag:** The script starts by fetching the most\n   recent SemVer release tag of the current branch, by looking at the local data\n   available in your repository.\n1. **Prompting for a new release tag:** The user is then prompted to enter a new\n   release tag. To assist with this, the script displays the tag retrieved in\n   the previous step, and validates the format of the inputted tag (vX.X.X). The\n   user is also reminded to update the version field in package.json.\n1. **Tagging the new release:** The script then tags a new release and syncs the\n   separate major tag (e.g. v1, v2) with the new release tag (e.g. v1.0.0,\n   v2.1.2). When the user is creating a new major release, the script\n   auto-detects this and creates a `releases/v#` branch for the previous major\n   version.\n1. **Pushing changes to remote:** Finally, the script pushes the necessary\n   commits, tags and branches to the remote repository. From here, you will need\n   to create a new release in GitHub so users can easily reference the new tags\n   in their workflows.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryant-finney%2Ffix-pr-title","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbryant-finney%2Ffix-pr-title","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryant-finney%2Ffix-pr-title/lists"}