Skip to content

Commit f0b3a5b

Browse files
build(deps): Bump the ci-cd group across 1 directory with 3 updates (#413)
* build(deps): Bump the ci-cd group across 1 directory with 3 updates Bumps the ci-cd group with 3 updates in the /.github/scripts directory: [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core), [@actions/github](https://github.com/actions/toolkit/tree/HEAD/packages/github) and [semver](https://github.com/npm/node-semver). Updates `@actions/core` from 2.0.1 to 3.0.0 - [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md) - [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core) Updates `@actions/github` from 6.0.1 to 9.0.0 - [Changelog](https://github.com/actions/toolkit/blob/main/packages/github/RELEASES.md) - [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/github) Updates `semver` from 7.7.3 to 7.7.4 - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md) - [Commits](npm/node-semver@v7.7.3...v7.7.4) --- updated-dependencies: - dependency-name: "@actions/core" dependency-version: 3.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: ci-cd - dependency-name: "@actions/github" dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: ci-cd - dependency-name: semver dependency-version: 7.7.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ci-cd ... Signed-off-by: dependabot[bot] <support@github.com> * Update stuff * Fix pnpm version fetching * more fixes --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: hhvrc <github@heavenvr.tech>
1 parent abcf8c0 commit f0b3a5b

File tree

9 files changed

+187
-223
lines changed

9 files changed

+187
-223
lines changed

.github/actions/build-frontend/action.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
name: build-frontend
22
description: Builds the frontend and uploads it as an artifact
33
inputs:
4-
pnpm-version:
5-
description: 'pnpm version to use'
6-
required: true
7-
node-version:
8-
description: 'NodeJS runtime version to use'
9-
required: true
104
skip-checkout:
115
description: 'If true, skips checkout'
126
default: false
@@ -24,12 +18,12 @@ runs:
2418
- uses: pnpm/action-setup@v4
2519
name: Install pnpm
2620
with:
27-
version: ${{ inputs.pnpm-version }}
21+
package_json_file: ./frontend/package.json
2822
run_install: false
2923

3024
- uses: actions/setup-node@v4
3125
with:
32-
node-version-file: ./frontend/.nvmrc
26+
node-version-file: ./frontend/package.json
3327
cache: 'pnpm'
3428
cache-dependency-path: ./frontend/pnpm-lock.yaml
3529

.github/scripts/get-vars.js

Lines changed: 53 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import fs from 'fs';
1+
import { setFailed, setOutput } from '@actions/core';
22
import ini from 'ini';
3+
import child_process from 'node:child_process';
4+
import fs from 'node:fs';
35
import semver from 'semver';
4-
import core from '@actions/core';
5-
import child_process from 'child_process';
66

77
// Get branch name
88
const gitRef = process.env.GITHUB_REF;
99
if (gitRef === undefined) {
10-
core.setFailed('Environment variable "GITHUB_REF" not found');
10+
setFailed('Environment variable "GITHUB_REF" not found');
1111
process.exit();
1212
}
1313

@@ -16,34 +16,37 @@ const isGitBranch = gitRef.startsWith('refs/heads/');
1616
const isGitPullRequest = gitRef.startsWith('refs/pull/') && gitRef.endsWith('/merge');
1717

1818
if (!isGitTag && !isGitBranch && !isGitPullRequest) {
19-
core.setFailed(`Git ref "${gitRef}" is not a valid branch, tag or pull request`);
19+
setFailed(`Git ref "${gitRef}" is not a valid branch, tag or pull request`);
2020
process.exit();
2121
}
2222

2323
const gitCommitHash = process.env.GITHUB_SHA;
2424
const gitShortCommitHash = gitCommitHash.substring(0, 8);
2525

2626
if (gitCommitHash === undefined) {
27-
core.setFailed('Environment variable "GITHUB_SHA" not found');
27+
setFailed('Environment variable "GITHUB_SHA" not found');
2828
process.exit();
2929
}
3030

3131
const gitHeadRefName = isGitPullRequest ? process.env.GITHUB_HEAD_REF : gitRef.split('/')[2];
3232
if (gitHeadRefName === undefined) {
33-
core.setFailed('Failed to get git head ref name');
33+
setFailed('Failed to get git head ref name');
3434
process.exit();
3535
}
3636

37-
const gitTagsList = child_process.execSync('git for-each-ref --sort=-creatordate --format "%(refname:short)" refs/tags').toString().trim();
37+
const gitTagsList = child_process
38+
.execSync('git for-each-ref --sort=-creatordate --format "%(refname:short)" refs/tags')
39+
.toString()
40+
.trim();
3841
if (gitTagsList === undefined) {
39-
core.setFailed('Failed to get latest git tag');
42+
setFailed('Failed to get latest git tag');
4043
process.exit();
4144
}
4245

4346
function convertGitTagToSemver(tag) {
4447
const parsed = semver.parse(tag === '' ? '0.0.0' : tag);
4548
if (parsed === null || parsed.loose) {
46-
core.setFailed(`Git tag "${tag}" is not a valid semver version`);
49+
setFailed(`Git tag "${tag}" is not a valid semver version`);
4750
process.exit();
4851
}
4952

@@ -112,7 +115,7 @@ function getVersionChangeLog(lines) {
112115

113116
// Enforce that the changelog is not empty if we are on the master branch
114117
if (isGitTag && emptyChangelog) {
115-
core.setFailed('File "CHANGELOG.md" is empty, this must be populated in the master branch');
118+
setFailed('File "CHANGELOG.md" is empty, this must be populated in the master branch');
116119
process.exit();
117120
}
118121

@@ -122,36 +125,47 @@ function getVersionChangeLog(lines) {
122125

123126
// Simple validation of the changelog
124127
if (!lines[0].startsWith('# Version ')) {
125-
core.setFailed('File "CHANGELOG.md" must start with "# Version <version>" followed by a changelog entry');
128+
setFailed(
129+
'File "CHANGELOG.md" must start with "# Version <version>" followed by a changelog entry'
130+
);
126131
process.exit();
127132
}
128133

129134
// Get the start of the entry
130135
const changeLogBegin = lines.findIndex((line) => line.startsWith(`# Version ${currentVersion}`));
131136
if (isGitTag && changeLogBegin === -1) {
132-
core.setFailed(`File "CHANGELOG.md" does not contain a changelog entry for version "${currentVersion}", this must be added in the master branch`);
137+
setFailed(
138+
`File "CHANGELOG.md" does not contain a changelog entry for version "${currentVersion}", this must be added in the master branch`
139+
);
133140
process.exit();
134141
}
135142

136143
// Enforce that the changelog entry is at the top of the file if we are on the master branch
137144
if (isGitTag && changeLogBegin !== 0) {
138-
core.setFailed(`Changelog entry for version "${currentVersion}" is not at the top of the file, you tag is either out of date or you have not updated the changelog`);
145+
setFailed(
146+
`Changelog entry for version "${currentVersion}" is not at the top of the file, you tag is either out of date or you have not updated the changelog`
147+
);
139148
process.exit();
140149
}
141150

142151
// Get the end of the entry
143-
let changeLogEnd = lines.slice(changeLogBegin + 1).findIndex((line) => line.startsWith('# Version '));
152+
let changeLogEnd = lines
153+
.slice(changeLogBegin + 1)
154+
.findIndex((line) => line.startsWith('# Version '));
144155
if (changeLogEnd === -1) {
145156
changeLogEnd = lines.length;
146157
} else {
147158
changeLogEnd += changeLogBegin + 1;
148159
}
149160

150-
const emptyChangelogEntry = lines.slice(changeLogBegin + 1, changeLogEnd).filter((line) => line.trim() !== '').length === 0;
161+
const emptyChangelogEntry =
162+
lines.slice(changeLogBegin + 1, changeLogEnd).filter((line) => line.trim() !== '').length === 0;
151163

152164
// Enforce that the changelog entry is not empty if we are on the master branch
153165
if (isGitTag && emptyChangelogEntry) {
154-
core.setFailed(`Changelog entry for version "${currentVersion}" is empty, this must be populated in the master branch`);
166+
setFailed(
167+
`Changelog entry for version "${currentVersion}" is empty, this must be populated in the master branch`
168+
);
155169
process.exit();
156170
}
157171

@@ -161,7 +175,7 @@ function getVersionChangeLog(lines) {
161175
// Make sure we have all the files we need
162176
for (const file of ['RELEASE.md', 'CHANGELOG.md', 'platformio.ini']) {
163177
if (!fs.existsSync(file)) {
164-
core.setFailed(`File "${file}" not found`);
178+
setFailed(`File "${file}" not found`);
165179
process.exit();
166180
}
167181
}
@@ -174,7 +188,9 @@ const platformioIniStr = fs.readFileSync('platformio.ini', 'utf8').trim();
174188
const fullChangelogLines = fullChangelog.split('\n');
175189

176190
// Get all versions from the changelog
177-
const changelogVersions = fullChangelogLines.filter((line) => line.startsWith('# Version ')).map((line) => line.substring(10).split(' ')[0].trim());
191+
const changelogVersions = fullChangelogLines
192+
.filter((line) => line.startsWith('# Version '))
193+
.map((line) => line.substring(10).split(' ')[0].trim());
178194

179195
// Get the changelog for the current version
180196
const versionChangeLog = getVersionChangeLog(fullChangelogLines);
@@ -187,13 +203,14 @@ for (const tag of gitTagsArray) {
187203
}
188204
}
189205
if (missingTags.length > 0) {
190-
core.setFailed(`Changelog is missing the following tags: ${missingTags.join(', ')}`);
206+
setFailed(`Changelog is missing the following tags: ${missingTags.join(', ')}`);
191207
process.exit();
192208
}
193209

194210
// Finish building the release string
195211
if (versionChangeLog !== '') {
196-
releaseNotes = `# OpenShock Firmware ${currentVersion}\n\n${versionChangeLog}\n\n${releaseNotes}`.trim();
212+
releaseNotes =
213+
`# OpenShock Firmware ${currentVersion}\n\n${versionChangeLog}\n\n${releaseNotes}`.trim();
197214
} else {
198215
releaseNotes = `# OpenShock Firmware ${currentVersion}\n\n${releaseNotes}`.trim();
199216
}
@@ -221,18 +238,18 @@ console.log('Beta: ' + betaReleasesArray.join(', '));
221238
console.log('Dev: ' + devReleasesArray.join(', '));
222239

223240
// Set outputs
224-
core.setOutput('version', currentVersion);
225-
core.setOutput('changelog', versionChangeLog);
226-
core.setOutput('release-notes', releaseNotes);
227-
core.setOutput('release-channel', currentChannel);
228-
core.setOutput('full-changelog', fullChangelog);
229-
core.setOutput('board-list', boards.join('\n'));
230-
core.setOutput('board-array', JSON.stringify(boards));
231-
core.setOutput('board-matrix', JSON.stringify({ board: boards }));
232-
core.setOutput('should-deploy', shouldDeploy);
233-
core.setOutput('release-stable-list', stableReleasesArray.join('\n'));
234-
core.setOutput('release-stable-array', JSON.stringify(stableReleasesArray));
235-
core.setOutput('release-beta-list', betaReleasesArray.join('\n'));
236-
core.setOutput('release-beta-array', JSON.stringify(betaReleasesArray));
237-
core.setOutput('release-dev-list', devReleasesArray.join('\n'));
238-
core.setOutput('release-dev-array', JSON.stringify(devReleasesArray));
241+
setOutput('version', currentVersion);
242+
setOutput('changelog', versionChangeLog);
243+
setOutput('release-notes', releaseNotes);
244+
setOutput('release-channel', currentChannel);
245+
setOutput('full-changelog', fullChangelog);
246+
setOutput('board-list', boards.join('\n'));
247+
setOutput('board-array', JSON.stringify(boards));
248+
setOutput('board-matrix', JSON.stringify({ board: boards }));
249+
setOutput('should-deploy', shouldDeploy);
250+
setOutput('release-stable-list', stableReleasesArray.join('\n'));
251+
setOutput('release-stable-array', JSON.stringify(stableReleasesArray));
252+
setOutput('release-beta-list', betaReleasesArray.join('\n'));
253+
setOutput('release-beta-array', JSON.stringify(betaReleasesArray));
254+
setOutput('release-dev-list', devReleasesArray.join('\n'));
255+
setOutput('release-dev-array', JSON.stringify(devReleasesArray));

.github/scripts/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
"test": "echo \"Error: no test specified\" && exit 1"
99
},
1010
"dependencies": {
11-
"@actions/core": "^2.0.1",
12-
"@actions/github": "^6.0.1",
11+
"@actions/core": "^3.0.0",
12+
"@actions/github": "^9.0.0",
1313
"ini": "^6.0.0",
14-
"semver": "^7.7.3"
14+
"semver": "^7.7.4"
1515
},
1616
"engines": {
17-
"node": "^22.14.0",
18-
"pnpm": "^10.6.4"
17+
"node": "^24.13.1",
18+
"pnpm": "^10.29.3"
1919
},
2020
"volta": {
21-
"node": "22.14.0"
21+
"node": "24.13.1"
2222
},
23-
"packageManager": "pnpm@10.6.4"
23+
"packageManager": "pnpm@10.29.3"
2424
}

0 commit comments

Comments
 (0)