include: # 包含node、git的远程开发流水线模版 - https://cnb.cool/cnb/plugins/node-git-dev/-/blob/main/.node-git-dev.yml .upload_plugin_info: &upload_plugin_info - stages: - name: install script: npm install --production --registry https://mirrors.cloud.tencent.com/help/npm.html - name: download plugin files if: | [ "$CNB_EVENT" = "api_trigger_upload_plugin_info" ] script: node ./src/down.js -token=$CNB_TOKEN -path=$PLUGIN_PATH -slug=$API_TRIGGER_REPO_SLUG -ref=$API_TRIGGER_BRANCH - name: gather plugins script: node ./src/gather.js -prefix=$CNB_WEB_ENDPOINT/$CNB_REPO_SLUG/-/git/raw/$CNB_BRANCH/plugins/ -ref=$API_TRIGGER_BRANCH - name: add plugins info if: | git_status=$(git status --porcelain) echo "$git_status" if [[ -n $git_status ]]; then exit 0 else exit 1 fi script: - git add . - git commit -m "add plugin files by ci" - git push origin $CNB_BRANCH -o ci.skip main: push: *upload_plugin_info api_trigger_upload_plugin_info: *upload_plugin_info