diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 253fc2b..ac981c4 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,7 +13,7 @@ jobs: run-tests: runs-on: ubuntu-latest env: - GO_VERSION: "~1.23" + GO_VERSION: "~1.25" GO111MODULE: "on" USE_CODECOV: true diff --git a/README.md b/README.md index 2d21c60..a435d7e 100644 --- a/README.md +++ b/README.md @@ -135,18 +135,35 @@ git co-last # switch from feature/my-feature to main ``` ## JIRA Integration +The `branch:recent` command can be run with the `--jira` flag to refine the ordering of the results using live data from JIRA. When your branch names include a JIRA issue key, branches tied to active issues you've updated recently appear closer to the top. -The `branch:recent` command can be run with the `--jira` flag to slightly modify the ordering of the results based on open issues in JIRA. Assuming your branches contain -the JIRA issue key in the branch name, the command will rank branches with open issues that have been updated recently slightly higher in the list. +### Configuration -Tickets with a higher numerical suffix and have been recently updated are ranked slightly higher in the list, -while tickets that have not been updated recently are ranked lower. +1. **Create an API token** + - Visit [Atlassian API Tokens](https://id.atlassian.com/manage-profile/security/api-tokens). + - Click **Create API token** and copy the generated value. -```bash -git-ninja branch:recent --jira -``` +2. **Configure credentials** + + Create a `.env` file in your project root: + + ```env + JIRA_API_TOKEN=your-token + JIRA_SUBDOMAIN=acme + JIRA_EMAIL_ADDRESS=you@example.com + ``` + + **Important:** Do not commit `.env` to version control. Add it to `.gitignore` to keep your credentials secure. + +3. **Run `branch:recent` with the `--jira` flag** + + ```bash + git-ninja branch:recent --jira + ``` -To enable the JIRA integration, set the `JIRA_API_TOKEN`, `JIRA_SUBDOMAIN` and `JIRA_EMAIL_ADDRESS` environment variables. +Results are cached for 5 minutes to avoid repeated API calls. +Recently updated issues rank higher; inactive ones rank lower. +If cache TTL is configurable, document the flag or env var here. ## Development Setup