feat: 添加多条件搜索 #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto Deploy | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14.x' | ||
- name: List Branches | ||
id: branch_list | ||
run: | | ||
git fetch --all --prune | ||
branches=$(git branch -r --no-color | awk '{print $1}') | ||
branch_list=(${branches//origin\//}) | ||
echo "::set-output name=branches::${branch_list[@]}" | ||
- name: Deploy | ||
run: | | ||
Check failure on line 30 in .github/workflows/main.yml GitHub Actions / Auto DeployInvalid workflow file
|
||
# 使用 ${{ needs.<step_id>.outputs.<output_name> }} 获取分支列表 | ||
# 在这里执行自动部署逻辑,例如使用分支列表来触发构建或部署 | ||
echo "Branches: ${{ needs.branch_list.outputs.branches }}" |