我需要在一个分支中构建一些文件,然后使用github操作将新形成和更新的文件推到同一个存储库的另一个分支。我已经尝试过这种方法,但在commit to staging branch
时总是失败
name: Deployment
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build files and folders
run: |
./build.sh
rm -rf cache
mkdir logs
cd logs
ls>output.txt
- name: commit to staging
run: |
git checkout staging
git add *
git commit -m "new push to staging"
git push
错误
/home/runner/work/_temp/c305681-ab7e-42f8-b39c-8ef35264cff.sh: line 1: github: command not found
Error: Process completed with exit code 127
1条答案
按热度按时间hfyxw5xn1#
默认情况下,
actions/checkout
只提取一个提交,不提取其他分支。然后再检查。