Skip to content

Commit fe12d0a

Browse files
feat!: upgrade GitHub Actions runtime from node20 to node24 (#160)
* feat!: upgrade to node24 runtime and remove deprecated input BREAKING CHANGE: Updated GitHub Actions runtime from node20 to node24. Bumped major version to v4. Removed deprecated append-work-item-title input - use add-work-item-table instead. * chore: sync copilot-instructions.md with reference template * chore: update actions/checkout to v6 in README * chore: update publish-github-action to v3 * chore: update npm-version-check-action to v2
1 parent 9378a59 commit fe12d0a

10 files changed

Lines changed: 23 additions & 50 deletions

File tree

.github/copilot-instructions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ const { functionToTest } = await import('../src/index.js');
5959

6060
### Node Runtime
6161

62-
- Use the same Node.js runtime version configured in this repo's `action.yml` (currently `node20`) for `runs.using`
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`
6364
- 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
6465

6566
### Input Handling

.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: 6 additions & 3 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`)
@@ -51,9 +55,9 @@ jobs:
5155
pull-requests: write
5256

5357
steps:
54-
- uses: actions/checkout@v4
58+
- uses: actions/checkout@v6
5559
- name: Azure DevOps Commit Validator and Pull Request Linker
56-
uses: joshjohanning/azdo_commit_message_validator@v2
60+
uses: joshjohanning/azdo_commit_message_validator@v4
5761
with:
5862
check-pull-request: true
5963
check-commits: true
@@ -74,7 +78,6 @@ jobs:
7478
| `link-commits-to-pull-request` | Only if `check-commits=true`, link the work items found in commits to the pull request | `false` | `true` |
7579
| `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` |
7680
| `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` |
77-
| `append-work-item-title` | **Deprecated** - use `add-work-item-table` instead. Will be removed in a future major version. | `false` | `false` |
7881
| `azure-devops-organization` | Only if `check-commits=true`, link the work items found in commits to the pull request | `false` | `''` |
7982
| `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` | `''` |
8083
| `github-token` | The GitHub token that has contents-read and pull_request-write access | `true` | `${{ github.token }}` |

__tests__/index.test.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ describe('Azure DevOps Commit Validator', () => {
9090
'github-token': 'github-token',
9191
'comment-on-failure': 'true',
9292
'validate-work-item-exists': 'false',
93-
'append-work-item-title': 'false',
9493
'add-work-item-table': 'false'
9594
};
9695
return defaults[name] || '';
@@ -846,34 +845,6 @@ describe('Azure DevOps Commit Validator', () => {
846845
);
847846
});
848847

849-
it('should support deprecated append-work-item-title input as alias', async () => {
850-
mockGetInput.mockImplementation(name => {
851-
if (name === 'check-commits') return 'false';
852-
if (name === 'check-pull-request') return 'true';
853-
if (name === 'github-token') return 'github-token';
854-
if (name === 'comment-on-failure') return 'false';
855-
if (name === 'validate-work-item-exists') return 'false';
856-
if (name === 'append-work-item-title') return 'true';
857-
if (name === 'azure-devops-token') return 'azdo-token';
858-
if (name === 'azure-devops-organization') return 'my-org';
859-
return '';
860-
});
861-
862-
mockOctokit.rest.pulls.get.mockResolvedValue({
863-
data: {
864-
title: 'feat: new feature',
865-
body: 'This PR implements AB#12345'
866-
}
867-
});
868-
869-
mockGetWorkItemTitle.mockResolvedValue({ title: 'Fix login bug', type: 'Bug' });
870-
871-
await run();
872-
873-
expect(mockSetFailed).not.toHaveBeenCalled();
874-
expect(mockOctokit.rest.pulls.update).toHaveBeenCalled();
875-
});
876-
877848
it('should update section when work item titles section already exists', async () => {
878849
mockGetInput.mockImplementation(name => {
879850
if (name === 'check-commits') return 'false';

action.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,11 @@ inputs:
4444
description: 'Validate that the work item(s) referenced in commits and PR exist in Azure DevOps. Requires azure-devops-token and azure-devops-organization to be set.'
4545
required: false
4646
default: 'true'
47-
append-work-item-title:
48-
description: 'Deprecated: Use add-work-item-table instead. This input will be removed in a future major version.'
49-
deprecationMessage: 'The append-work-item-title input is deprecated. Use add-work-item-table instead.'
50-
required: false
51-
default: 'false'
5247
add-work-item-table:
5348
description: 'Add a Linked Work Items table to the PR body showing titles for AB#xxx references (original AB# references are preserved). Requires azure-devops-token and azure-devops-organization to be set.'
5449
required: false
5550
default: 'false'
5651

5752
runs:
58-
using: 'node20'
53+
using: 'node24'
5954
main: 'dist/index.js'

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

package-lock.json

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"name": "azure-devops-work-item-link-enforcer-and-linker",
3-
"version": "3.2.2",
3+
"version": "4.0.0",
44
"private": true,
55
"type": "module",
66
"description": "GitHub Action to enforce that each commit in a pull request be linked to an Azure DevOps work item and automatically link the pull request to each work item ",
7+
"engines": {
8+
"node": ">=24"
9+
},
710
"main": "dist/index.js",
811
"scripts": {
912
"format": "npx prettier --write .",

src/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ export async function run() {
4343
const githubToken = core.getInput('github-token');
4444
const commentOnFailure = core.getInput('comment-on-failure') === 'true';
4545
const validateWorkItemExistsFlag = core.getInput('validate-work-item-exists') === 'true';
46-
const addWorkItemTableRaw = core.getInput('add-work-item-table');
47-
const appendWorkItemTitleRaw = core.getInput('append-work-item-title');
48-
const addWorkItemTable =
49-
addWorkItemTableRaw === 'true' || (addWorkItemTableRaw !== 'true' && appendWorkItemTitleRaw === 'true');
46+
const addWorkItemTable = core.getInput('add-work-item-table') === 'true';
5047

5148
// Warn if an invalid scope value was provided
5249
if (checkPullRequest && pullRequestCheckScopeRaw && !validScopes.includes(pullRequestCheckScopeRaw)) {

0 commit comments

Comments
 (0)