diff --git a/.github/CONTRIBUTING.md b/CONTRIBUTING.md similarity index 71% rename from .github/CONTRIBUTING.md rename to CONTRIBUTING.md index f740410d3b..9d465bf68e 100644 --- a/.github/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,3 +23,21 @@ * Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. + +## Development of this action + +1. Install [act](https://github.com/nektos/act#installation) +2. Make a symlink for `act` to work properly: `ln -s . golangci-lint-action` +3. Install dependencies: `npm install` +4. Build: `npm run build` +5. Run `npm run local` after any change to test it + +### Releases + +```bash +npm version -m "Upgrade to %s" +``` + +- https://docs.npmjs.com/cli/v11/commands/npm-version + +The "major tag" (ex: `v6`) should be deleted and then recreated manually. diff --git a/README.md b/README.md index 6ccbd0283b..be93de974d 100644 --- a/README.md +++ b/README.md @@ -539,11 +539,3 @@ Inside our action, we perform 3 steps: GitHub matches keys by prefix if we have no exact match for the primary cache. This scheme is basic and needs improvements. Pull requests and ideas are welcome. - -## Development of this action - -1. Install [act](https://github.com/nektos/act#installation) -2. Make a symlink for `act` to work properly: `ln -s . golangci-lint-action` -3. Install dependencies: `npm install` -4. Build: `npm run build` -5. Run `npm run local` after any change to test it diff --git a/dist/post_run/index.js b/dist/post_run/index.js index e77a41cfff..806438ccf4 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -93982,7 +93982,7 @@ async function prepareEnv() { const binPath = await prepareLint(); const patchPath = await fetchPatch(); core.info(`Prepared env in ${Date.now() - startedAt}ms`); - return { binPath: binPath, patchPath }; + return { binPath, patchPath }; } const printOutput = (res) => { if (res.stdout) { @@ -93992,10 +93992,10 @@ const printOutput = (res) => { core.info(res.stderr); } }; -async function runLint(lintPath, patchPath) { +async function runLint(binPath, patchPath) { const debug = core.getInput(`debug`); if (debug.split(`,`).includes(`cache`)) { - const res = await execShellCommand(`${lintPath} cache status`); + const res = await execShellCommand(`${binPath} cache status`); printOutput(res); } let userArgs = core.getInput(`args`); @@ -94068,7 +94068,7 @@ async function runLint(lintPath, patchPath) { } cmdArgs.cwd = path.resolve(workingDirectory); } - const cmd = `${lintPath} run ${addedArgs.join(` `)} ${userArgs}`.trimEnd(); + const cmd = `${binPath} run ${addedArgs.join(` `)} ${userArgs}`.trimEnd(); core.info(`Running [${cmd}] in [${cmdArgs.cwd || process.cwd()}] ...`); const startedAt = Date.now(); try { diff --git a/dist/run/index.js b/dist/run/index.js index e32f5883d5..aeb04979ac 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -93982,7 +93982,7 @@ async function prepareEnv() { const binPath = await prepareLint(); const patchPath = await fetchPatch(); core.info(`Prepared env in ${Date.now() - startedAt}ms`); - return { binPath: binPath, patchPath }; + return { binPath, patchPath }; } const printOutput = (res) => { if (res.stdout) { @@ -93992,10 +93992,10 @@ const printOutput = (res) => { core.info(res.stderr); } }; -async function runLint(lintPath, patchPath) { +async function runLint(binPath, patchPath) { const debug = core.getInput(`debug`); if (debug.split(`,`).includes(`cache`)) { - const res = await execShellCommand(`${lintPath} cache status`); + const res = await execShellCommand(`${binPath} cache status`); printOutput(res); } let userArgs = core.getInput(`args`); @@ -94068,7 +94068,7 @@ async function runLint(lintPath, patchPath) { } cmdArgs.cwd = path.resolve(workingDirectory); } - const cmd = `${lintPath} run ${addedArgs.join(` `)} ${userArgs}`.trimEnd(); + const cmd = `${binPath} run ${addedArgs.join(` `)} ${userArgs}`.trimEnd(); core.info(`Running [${cmd}] in [${cmdArgs.cwd || process.cwd()}] ...`); const startedAt = Date.now(); try { diff --git a/package-lock.json b/package-lock.json index 92152a4d2c..7fb338ddb4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "golanci-lint-action", - "version": "6.3.1", + "version": "6.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "golanci-lint-action", - "version": "6.3.1", + "version": "6.3.2", "license": "MIT", "dependencies": { "@actions/cache": "^4.0.0", @@ -31,7 +31,7 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.3", "eslint-plugin-simple-import-sort": "^12.1.1", - "prettier": "^3.4.2", + "prettier": "^3.5.0", "typescript": "^5.7.3" } }, @@ -3119,10 +3119,11 @@ } }, "node_modules/prettier": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", - "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.0.tgz", + "integrity": "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index cb5f4f9501..1bdf3c4137 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "golanci-lint-action", - "version": "6.3.1", + "version": "6.3.2", "private": true, "description": "golangci-lint github action", "main": "dist/main.js", @@ -46,7 +46,7 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.3", "eslint-plugin-simple-import-sort": "^12.1.1", - "prettier": "^3.4.2", + "prettier": "^3.5.0", "typescript": "^5.7.3" } } diff --git a/src/run.ts b/src/run.ts index fb39467b2f..da83f1e840 100644 --- a/src/run.ts +++ b/src/run.ts @@ -156,7 +156,7 @@ async function prepareEnv(): Promise { core.info(`Prepared env in ${Date.now() - startedAt}ms`) - return { binPath: binPath, patchPath } + return { binPath, patchPath } } type ExecRes = { @@ -173,10 +173,10 @@ const printOutput = (res: ExecRes): void => { } } -async function runLint(lintPath: string, patchPath: string): Promise { +async function runLint(binPath: string, patchPath: string): Promise { const debug = core.getInput(`debug`) if (debug.split(`,`).includes(`cache`)) { - const res = await execShellCommand(`${lintPath} cache status`) + const res = await execShellCommand(`${binPath} cache status`) printOutput(res) } @@ -266,7 +266,7 @@ async function runLint(lintPath: string, patchPath: string): Promise { cmdArgs.cwd = path.resolve(workingDirectory) } - const cmd = `${lintPath} run ${addedArgs.join(` `)} ${userArgs}`.trimEnd() + const cmd = `${binPath} run ${addedArgs.join(` `)} ${userArgs}`.trimEnd() core.info(`Running [${cmd}] in [${cmdArgs.cwd || process.cwd()}] ...`)