Skip to content

Commit bfd6b66

Browse files
committed
Merge branch 'main' into add-work-item-linkage-from-branch-name
2 parents edec350 + fe12d0a commit bfd6b66

10 files changed

Lines changed: 992 additions & 966 deletions

File tree

.github/copilot-instructions.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ const { functionToTest } = await import('../src/index.js');
5757

5858
## GitHub Actions Patterns
5959

60+
### Node Runtime
61+
62+
- Only use Node.js runtimes officially supported by GitHub Actions (see [GitHub Actions documentation](https://docs.github.com/en/actions/sharing-automations/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions) for current supported versions)
63+
- Use the same Node.js runtime version configured in this repo's `action.yml` for `runs.using`
64+
- When updating Node.js support, update `runs.using` in `action.yml`, the `engines.node` range in `package.json`, and CI/test matrices together to stay consistent
65+
6066
### Input Handling
6167

6268
- Use our custom `getInput()` function for reliable local/CI compatibility
@@ -96,14 +102,20 @@ const { functionToTest } = await import('../src/index.js');
96102

97103
- Use `npm run package` to bundle with ncc
98104
- Don't commit the bundled `dist/` directory (during publishing this gets published to **tag-only**)
99-
- Run `npm run all` before committing (format, lint, test, package)
105+
- Run `npm run all` before committing (format, lint, test, package, and badge updating)
106+
107+
### Dependency and Version Changes
108+
109+
- When bumping versions or changing dependencies, run `npm install` first to sync the `package-lock.json`, then run `npm run all`
110+
- Do not skip these steps -- a mismatched `package-lock.json` or failing checks will break CI
100111

101112
## Documentation Standards
102113

103-
### README Updates
114+
### README and action.yml Updates
104115

105-
- Keep usage examples up to date with `action.yml`
106-
- Document all inputs and outputs
116+
- **Always update `README.md` and `action.yml` when adding, removing, or changing inputs, outputs, or behavior** -- do not forget this step
117+
- Keep usage examples in the README in sync with `action.yml`
118+
- Document all inputs and outputs in both `action.yml` (descriptions/defaults) and `README.md` (usage table/examples)
107119
- Include local development instructions
108120
- Update feature lists when adding functionality
109121

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup Node.js
2121
uses: actions/setup-node@v6
2222
with:
23-
node-version: '20'
23+
node-version: '24'
2424
cache: 'npm'
2525

2626
- name: Install dependencies
@@ -49,4 +49,4 @@ jobs:
4949
fi
5050
5151
- name: Check npm version compatibility
52-
uses: joshjohanning/npm-version-check-action@v1
52+
uses: joshjohanning/npm-version-check-action@v2

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v6
1717
with:
1818
persist-credentials: false
19-
- uses: joshjohanning/publish-github-action@v2
19+
- uses: joshjohanning/publish-github-action@v3
2020
with:
2121
github_token: ${{ secrets.GITHUB_TOKEN }}
2222
npm_package_command: npm run package

README.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
This action validates that pull requests and commits contain Azure DevOps work item links (e.g. `AB#123`), and **automatically links the GitHub Pull Request to work items found in commit messages**.
1010

11+
## What's new
12+
13+
Please refer to the [release page](https://github.com/joshjohanning/azdo_commit_message_validator/releases) for the latest release notes.
14+
1115
## Key Features
1216

1317
1. **Validates Pull Requests** - Ensures PR title or body contains an Azure DevOps work item link (e.g. `AB#123`)
@@ -45,14 +49,16 @@ on:
4549
jobs:
4650
pr-commit-message-enforcer-and-linker:
4751
runs-on: ubuntu-latest
52+
# Skip runs triggered by azure-boards bot editing the PR body to avoid duplicate workflow runs
53+
if: github.actor != 'azure-boards[bot]'
4854
permissions:
4955
contents: read
5056
pull-requests: write
5157

5258
steps:
53-
- uses: actions/checkout@v4
59+
- uses: actions/checkout@v6
5460
- name: Azure DevOps Commit Validator and Pull Request Linker
55-
uses: joshjohanning/azdo_commit_message_validator@v2
61+
uses: joshjohanning/azdo_commit_message_validator@v4
5662
with:
5763
check-pull-request: true
5864
check-commits: true
@@ -64,20 +70,20 @@ jobs:
6470
6571
### Inputs
6672
67-
| Name | Description | Required | Default |
68-
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------------------- |
69-
| `check-pull-request` | Check the pull request for `AB#xxx` (scope configurable via `pull-request-check-scope`) | `true` | `false` |
70-
| `pull-request-check-scope` | Only if `check-pull-request=true`, where to look for `AB#` in the PR: `title-or-body`, `body-only`, or `title-only` | `false` | `title-or-body` |
71-
| `check-commits` | Check each commit in the pull request for `AB#xxx` | `true` | `true` |
72-
| `fail-if-missing-workitem-commit-link` | Only if `check-commits=true`, fail the action if a commit in the pull request is missing AB# in every commit message | `false` | `true` |
73-
| `link-commits-to-pull-request` | Only if `check-commits=true`, link the work items found in commits to the pull request | `false` | `true` |
74-
| `validate-work-item-exists` | Validate that the work item(s) referenced in commits and PR exist in Azure DevOps (requires `azure-devops-token` and `azure-devops-organization`) | `false` | `true` |
75-
| `append-work-item-title` | Append the work item title to `AB#xxx` references in the PR body (e.g. `AB#123` becomes `AB#123 - Fix bug`). Requires `azure-devops-token` and `azure-devops-organization` | `false` | `false` |
76-
| `add-work-item-from-branch` | Automatically extract work item ID(s) from the head branch name and add `AB#xxx` to the PR body if not already present. Only matches 3+ digit IDs. Requires `check-pull-request` or `check-commits` to also be enabled | `false` | `false` |
77-
| `azure-devops-organization` | Only if `check-commits=true`, link the work items found in commits to the pull request | `false` | `''` |
78-
| `azure-devops-token` | Only required if `link-commits-to-pull-request=true`, Azure DevOps PAT used to link work item to PR (needs to be a `full` PAT) | `false` | `''` |
79-
| `github-token` | The GitHub token that has contents-read and pull_request-write access | `true` | `${{ github.token }}` |
80-
| `comment-on-failure` | Comment on the pull request if the action fails | `true` | `true` |
73+
| Name | Description | Required | Default |
74+
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------------------- |
75+
| `check-pull-request` | Check the pull request for `AB#xxx` (scope configurable via `pull-request-check-scope`) | `true` | `false` |
76+
| `pull-request-check-scope` | Only if `check-pull-request=true`, where to look for `AB#` in the PR: `title-or-body`, `body-only`, or `title-only` | `false` | `title-or-body` |
77+
| `check-commits` | Check each commit in the pull request for `AB#xxx` | `true` | `true` |
78+
| `fail-if-missing-workitem-commit-link` | Only if `check-commits=true`, fail the action if a commit in the pull request is missing AB# in every commit message | `false` | `true` |
79+
| `link-commits-to-pull-request` | Only if `check-commits=true`, link the work items found in commits to the pull request | `false` | `true` |
80+
| `validate-work-item-exists` | Validate that the work item(s) referenced in commits and PR exist in Azure DevOps (requires `azure-devops-token` and `azure-devops-organization`) | `false` | `true` |
81+
| `add-work-item-table` | Add a "Linked Work Items" table to the PR body showing titles for `AB#xxx` references (original references are preserved). Requires `azure-devops-token` and `azure-devops-organization` | `false` | `false` |
82+
| `add-work-item-from-branch` | Automatically extract work item ID(s) from the head branch name and add `AB#xxx` to the PR body if not already present. Only matches 3+ digit IDs | `false` | `false` |
83+
| `azure-devops-organization` | Only if `check-commits=true`, link the work items found in commits to the pull request | `false` | `''` |
84+
| `azure-devops-token` | Only required if `link-commits-to-pull-request=true`, Azure DevOps PAT used to link work item to PR (needs to be a `full` PAT) | `false` | `''` |
85+
| `github-token` | The GitHub token that has contents-read and pull_request-write access | `true` | `${{ github.token }}` |
86+
| `comment-on-failure` | Comment on the pull request if the action fails | `true` | `true` |
8187

8288
## Screenshots
8389

0 commit comments

Comments
 (0)