diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index c86f06e2a1..ab6facd100 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -3,12 +3,10 @@ name: "Code Scanning - Action" on: push: branches: - - master - main pull_request: # The branches below must be a subset of the branches above branches: - - master - main schedule: - cron: '0 17 * * 5' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index af8bb9aeac..e3545a7755 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,13 +2,10 @@ name: "build-and-test" on: # rebuild any PRs and main branch changes pull_request: branches: - - master - main push: branches: - - master - main - - "releases/*" jobs: build: # make sure build/ci work properly @@ -51,7 +48,7 @@ jobs: matrix: os: - ubuntu-latest - - ubuntu-24.04-arm + - ubuntu-22.04-arm - macos-latest - windows-latest version: @@ -73,7 +70,6 @@ jobs: version: ${{ matrix.version }} args: --timeout=5m --issues-exit-code=0 ./sample/... only-new-issues: true - verify: true test-go-install: # make sure the action works on a clean machine without building (go-install mode) needs: [ build ] @@ -81,7 +77,7 @@ jobs: matrix: os: - ubuntu-latest - - ubuntu-24.04-arm + - ubuntu-22.04-arm - macos-latest - windows-latest version: @@ -104,7 +100,6 @@ jobs: args: --timeout=5m --issues-exit-code=0 ./sample/... only-new-issues: true install-mode: goinstall - verify: true test-go-mod: needs: [ build ] @@ -112,7 +107,7 @@ jobs: matrix: os: - ubuntu-latest - - ubuntu-24.04-arm + - ubuntu-22.04-arm - macos-latest - windows-latest wd: @@ -130,4 +125,3 @@ jobs: with: working-directory: ${{ matrix.wd }} args: --timeout=5m --issues-exit-code=0 ./... - verify: true diff --git a/action.yml b/action.yml index 5e8e8e3be1..1db3570795 100644 --- a/action.yml +++ b/action.yml @@ -24,7 +24,7 @@ inputs: required: false verify: description: "if set to true and the action verify the configuration file against the JSONSchema" - default: 'false' + default: 'true' required: false only-new-issues: description: "if set to true and the action runs on a pull request - the action outputs only newly found issues" diff --git a/dist/post_run/index.js b/dist/post_run/index.js index 367f3bf47e..ae8fda3b17 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -42098,7 +42098,7 @@ module.exports = __toCommonJS(dist_src_exports); var import_universal_user_agent = __nccwpck_require__(3843); // pkg/dist-src/version.js -var VERSION = "9.0.5"; +var VERSION = "9.0.6"; // pkg/dist-src/defaults.js var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; @@ -42203,9 +42203,9 @@ function addQueryParameters(url, parameters) { } // pkg/dist-src/util/extract-url-variable-names.js -var urlVariableRegex = /\{[^}]+\}/g; +var urlVariableRegex = /\{[^{}}]+\}/g; function removeNonChars(variableName) { - return variableName.replace(/^\W+|\W+$/g, "").split(/,/); + return variableName.replace(/(?:^\W+)|(?:(? { const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; return `application/vnd.github.${preview}-preview${format}`; @@ -45240,7 +45240,7 @@ var RequestError = class extends Error { if (options.request.headers.authorization) { requestCopy.headers = Object.assign({}, options.request.headers, { authorization: options.request.headers.authorization.replace( - / .*$/, + /(? { const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; return `application/vnd.github.${preview}-preview${format}`; @@ -45240,7 +45240,7 @@ var RequestError = class extends Error { if (options.request.headers.authorization) { requestCopy.headers = Object.assign({}, options.request.headers, { authorization: options.request.headers.authorization.replace( - / .*$/, + /(? { cmdArgs.cwd = path.resolve(workingDirectory) } - if (core.getBooleanInput(`verify`, { required: true })) { - let cmdVerify = `${binPath} config verify` - if (userArgsMap.get("config")) { - cmdVerify += ` --config=${userArgsMap.get("config")}` - } - - core.info(`Running [${cmdVerify}] in [${cmdArgs.cwd || process.cwd()}] ...`) - - const res = await execShellCommand(cmdVerify, cmdArgs) - printOutput(res) - } + await runVerify(binPath, userArgsMap, cmdArgs) const cmd = `${binPath} run ${addedArgs.join(` `)} ${userArgs}`.trimEnd() @@ -173,6 +163,44 @@ async function runLint(binPath: string, patchPath: string): Promise { core.info(`Ran golangci-lint in ${Date.now() - startedAt}ms`) } +async function runVerify(binPath: string, userArgsMap: Map, cmdArgs: ExecOptions): Promise { + const verify = core.getBooleanInput(`verify`, { required: true }) + if (!verify) { + return + } + + const cfgPath = await getConfigPath(binPath, userArgsMap, cmdArgs) + if (!cfgPath) { + return + } + + let cmdVerify = `${binPath} config verify` + if (userArgsMap.get("config")) { + cmdVerify += ` --config=${userArgsMap.get("config")}` + } + + core.info(`Running [${cmdVerify}] in [${cmdArgs.cwd || process.cwd()}] ...`) + + const res = await execShellCommand(cmdVerify, cmdArgs) + printOutput(res) +} + +async function getConfigPath(binPath: string, userArgsMap: Map, cmdArgs: ExecOptions): Promise { + let cmdConfigPath = `${binPath} config path` + if (userArgsMap.get("config")) { + cmdConfigPath += ` --config=${userArgsMap.get("config")}` + } + + core.info(`Running [${cmdConfigPath}] in [${cmdArgs.cwd || process.cwd()}] ...`) + + try { + const resPath = await execShellCommand(cmdConfigPath, cmdArgs) + return resPath.stderr.trim() + } catch { + return `` + } +} + export async function run(): Promise { try { const { binPath, patchPath } = await core.group(`prepare environment`, prepareEnv)