我正在尝试创建一个 GitHub 操作,该操作将检测某个分支何时发生更改,然后构建一个版本。I\xe2\x80\x99m 遇到的问题是在我的 yml 文件中我使用这一行:
\nncipollo/release-action@v1. 这需要有一个可用的标签,否则将会失败。我已经创建并推送了一个标签,但是当我运行该操作时出现此错误
\nError undefined: No tag found in ref or input!\nRun Code Online (Sandbox Code Playgroud)\n这是我的 yml 文件:
\n# Creates a release whenever a new change gets pushed onto the dev branch\n# https://github.com/ncipollo/release-action\n\nname: Dev-Build\non: \n push:\n branches:\n - dev\njobs:\n build:\n name: setup environment \n runs-on: ubuntu-latest\n strategy:\n matrix:\n node-version: [12.x]\n\n steps:\n - uses: actions/checkout@v2\n with:\n fetch-depth: 0\n - name: Cache node modules\n uses: actions/cache@v2.1.3\n with:\n path: ~/.npm\n key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}\n restore-keys: …Run Code Online (Sandbox Code Playgroud) 我正在使用 NestJS 尝试获取数据库下存在的集合列表。但是,如果我尝试使用该选项,{ nameOnly: true }我会得到一个空数组。
下面是我获取集合名称的代码:
@Get(':client_name/listCollections')
async collections(@Param('client_name') client_name) {
let arrayOfCollections;
const db = await this.databaseService.connectToDatabase(client_name);
try {
arrayOfCollections = await db
.listCollections({ nameOnly: true })
.toArray();
} catch (error) {
throw error;
}
if (arrayOfCollections) {
return arrayOfCollections;
}
}
Run Code Online (Sandbox Code Playgroud)
如果我删除{ nameOnly: true },那么我会得到完整的列表,但由于这会锁定数据库并返回我不需要的额外信息,所以如果可能的话,我想避免使用它。