Skip to content

Update main.yml

Update main.yml #3

Workflow file for this run

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

View workflow run for this annotation

GitHub Actions / Auto Deploy

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 30, Col: 12): Unexpected symbol: '<'. Located at position 7 within expression: needs.<step_id>.outputs.<output_name>
# 使用 ${{ needs.<step_id>.outputs.<output_name> }} 获取分支列表
# 在这里执行自动部署逻辑,例如使用分支列表来触发构建或部署
echo "Branches: ${{ needs.branch_list.outputs.branches }}"