te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>amazon web services - Unable to authenticate with codeartifact, unable to set creds in .yarnrc.yml for yarn.lock generation - St
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

amazon web services - Unable to authenticate with codeartifact, unable to set creds in .yarnrc.yml for yarn.lock generation - St

programmeradmin2浏览0评论

How are you running Renovate?

Self-hosted Renovate

If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.

Github, renovatebot/[email protected]

Please tell us more about your question or problem

Why is my workflow not able to authenticate properly with code artifact. And why is it not updating the local yarnrc.yml with codeartifact token given RENOVATE_NPMRC is provided to it?

Here is my renovate.yaml workflow:

name: Renovate

on:
  workflow_call:
    secrets:
      aws-access-key-id:
        required: true
      aws-secret-access-key:
        required: true
      github-token:
        required: true

jobs:
  codeartifact-token:
    runs-on: depot-ubuntu-22.04-small
    outputs:
      codeartifact-token: ${{ steps.login-codeartifact.outputs.codeartifact-token }}
    steps:
      - name: CodeArtifact Login (Internal NPM repo)
        id: login-codeartifact
        uses: <ORG>/github-actions-workflows/.github/actions/login-codeartifact@main
        with:
          aws-access-key-id: ${{ secrets.aws-access-key-id }}
          aws-secret-access-key: ${{ secrets.aws-secret-access-key }}

  renovate:
    runs-on: depot-ubuntu-22.04
    needs: [codeartifact-token]
    steps:
      - name: Checkout Repository
        uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

      - name: Renovate
        id: renovate
        uses: renovatebot/[email protected]
        env:
          RENOVATE_CONFIG_FILE: renovate.json5
          RENOVATE_REPOSITORIES: ${{ github.repository }}
          RENOVATE_TOKEN: ${{ secrets.github-token }}
          RENOVATE_DETECT_HOST_RULES_FROM_ENV: true
          RENOVATE_HOST_RULES: |
            [
              {
                "hostType": "npm",
                "matchHost": "https://<ORG>-<DOMAIN>.d.codeartifact.us-west-2.amazonaws/npm/shared/",
                "token": "${{ needs.codeartifact-token.outputs.codeartifact-token }}"
              },
            ]
          # so renovate updates .yarnrc.yml of the consumer with help of host rules.
          RENOVATE_NPMRC: "registry=https://<ORG>-<DOMAIN>.d.codeartifact.us-west-2.amazonaws/npm/shared/\n//<ORG>-<DOMAIN>.d.codeartifact.us-west-2.amazonaws/npm/shared/:_authToken=${{ needs.codeartifact-token.outputs.codeartifact-token }}\n//<ORG>-<DOMAIN>.d.codeartifact.us-west-2.amazonaws/npm/shared/:always-auth=true"
          LOG_LEVEL: debug
          

renovate.json5:

{
  "$schema": ".json",
  extends: [
    "config:recommended",
    "helpers:pinGitHubActionDigestsToSemver",
  ],
  gitAuthor: "Renovate Bot <[email protected]>",
  enabledManagers: [
    "npm",
    "nvm",
    "github-actions",
    "dockerfile",
  ],
  prConcurrentLimit: 0,
  prHourlyLimit: 0,
  commitMessageLowerCase: "never",
  commitMessageSuffix: "[SUB-2459]",
  stabilityDays: 21,
  internalChecksFilter: "strict",
  postUpdateOptions: ["yarnDedupeHighest"],
  packageRules: [
    {
      matchDepTypes: [
        "action"
      ],
      matchUpdateTypes: ["minor", "patch", "digest"],
      allowedVersions: ">=1.0.0",
      groupName: "GitHub Actions Minor/Patch Updates"
    }
  ]
}

.yarnrc.yml:

npmRegistryServer: "https://<ORG>-<DOMAIN>.d.codeartifact.us-west-2.amazonaws/npm/shared/"
npmRegistries:
  //<ORG>-<DOMAIN>.d.codeartifact.us-west-2.amazonaws/npm/shared/:
    npmAlwaysAuth: true

Logs (if relevant)

Unable to authenticate with code artifact

DEBUG: GET https://<ORG>-<DOMAIN>.d.codeartifact.us-west-2.amazonaws/npm/shared/@<ORG>%2Fds = (code=ERR_NON_2XX_3XX_RESPONSE, statusCode=401 retryCount=0, duration=193) (repository=<ORG>/soa-frontend-service-template)

Unable to override .yarnrc.yml with code artifact token to let yarn install work. File literally doesn't change

DEBUG: Writing package.json files (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
       "packageFiles": [
         ".yarn/sdks/eslint/package.json",
         ".yarn/sdks/prettier/package.json",
         ".yarn/sdks/typescript/package.json",
         "package.json"
       ]
DEBUG: Writing any updated package files (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Found 2 npm host rule(s) (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Adding npmrc entry for //<ORG>-972451838497.d.codeartifact.us-west-2.amazonaws/npm/shared/ with key _authToken (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Adding npmrc entry for //<ORG>-972451838497.d.codeartifact.us-west-2.amazonaws/npm/shared/ with key _authToken (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: npmrc file .npmrc found in repository (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Writing updated .npmrc file to .npmrc (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Added authentication to .yarnrc.yml (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Generating yarn.lock for . (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Spawning yarn install to create yarn.lock (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Using node constraint ">=20.10.0" from package.json (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Found yarn constraint in package.json packageManager: 4.6.0 (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Enabling global cache as zero-install is not detected (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Performing lockfileUpdate (yarn) (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Performing yarn dedupe highest (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Setting CONTAINERBASE_CACHE_DIR to /tmp/renovate/cache/containerbase (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Using containerbase dynamic installs (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
DEBUG: Resolved stable matching version (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
       "toolName": "node",
       "constraint": ">=20.10.0",
       "resolvedVersion": "v22.14.0"
DEBUG: Resolved stable matching version (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
       "toolName": "corepack",
       "constraint": undefined,
       "resolvedVersion": "0.31.0"
DEBUG: Executing command (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
       "command": "install-tool node v22.14.0"
DEBUG: exec completed (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
       "durationMs": 2162,
       "stdout": "[11:32:56.306] INFO (387): Installing tool [email protected]...\nv22.14.0\n10.9.2\n0.31.0\n[11:32:58.280] INFO (387): Install tool node succeeded in 1.9s.\n",
       "stderr": ""
DEBUG: Executing command (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
       "command": "install-tool corepack 0.31.0"
DEBUG: exec completed (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
       "durationMs": 1144,
       "stdout": "[11:32:58.467] INFO (424): Installing npm [email protected]...\n0.31.0\n[11:32:59.098] INFO (424): Install tool corepack succeeded in 634ms.\n",
       "stderr": ""
DEBUG: Executing command (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
       "command": "yarn install --mode=update-lockfile"
DEBUG: rawExec err (repository=<ORG>/soa-frontend-service-template, branch=renovate/<ORG>-eslint-config-2.x-lockfile)
       "err": {
         "cmd": "/bin/sh -c yarn install --mode=update-lockfile",
         "stderr": "! Corepack is about to download .6.0/packages/yarnpkg-cli/bin/yarn.js\n",
         "stdout": "➤ YN0000: · Yarn 4.6.0\n➤ YN0000: ┌ Resolution step\n➤ YN0000: └ Completed\n➤ YN0000: ┌ Post-resolution validation\n➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.\n➤ YN0000: └ Completed\n➤ YN0000: ┌ Fetch step\n➤ YN0041: │ fsevents@patch:fsevents@npm%3A2.3.3#optional!builtin<compat/fsevents>::version=2.3.3&hash=df0bf1: Invalid authentication (as an anonymous user)\n➤ YN0000: └ Completed in 6s 717ms\n➤ YN0000: · Failed with errors in 6s 912ms\n",
         "options": {
           "cwd": "/tmp/renovate/repos/github/<ORG>/soa-frontend-service-template",
           "encoding": "utf-8",
           "env": {
             "NPM_CONFIG_CACHE": "/tmp/renovate/cache/others/npm",
             "npm_config_store": "/tmp/renovate/cache/others/pnpm",
             "CI": "true",
             "YARN_ENABLE_IMMUTABLE_INSTALLS": "false",
             "YARN_HTTP_TIMEOUT": "100000",
             "YARN_GLOBAL_FOLDER": "/tmp/renovate/cache/others/berry",
             "YARN_ENABLE_GLOBAL_CACHE": "1",
             "HOME": "/home/ubuntu",
             "PATH": "/home/ubuntu/.local/bin:/home/ubuntu/bin:/home/ubuntu/.local/bin:/home/ubuntu/bin:/home/ubuntu/.local/bin:/home/ubuntu/bin:/home/ubuntu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
             "LC_ALL": "C.UTF-8",
             "LANG": "C.UTF-8",
             "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase"
           },
           "maxBuffer": 10485760,
           "timeout": 900000
         },
         "exitCode": 1,
         "name": "ExecError",
         "message": "Command failed: yarn install --mode=update-lockfile\n! Corepack is about to download .6.0/packages/yarnpkg-cli/bin/yarn.js\n",
         "stack": "ExecError: Command failed: yarn install --mode=update-lockfile\n! Corepack is about to download .6.0/packages/yarnpkg-cli/bin/yarn.js\n\n    at ChildProcess.<anonymous> (/usr/local/renovate/lib/util/exec/common.ts:119:11)\n    at ChildProcess.emit (node:events:536:35)\n    at ChildProcess.emit (node:domain:489:12)\n    at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)"
       },
       "durationMs": 7330

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论