我需要在一個分支中構建一些檔案,并使用 github 操作將新形成和更新的檔案推送到同一 repo 的另一個分支。我試過這種方式,但總是失敗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
uj5u.com熱心網友回復:
默認情況下actions/checkout只獲取一個提交,不獲取其他分支。您需要先使用獲取分支
git fetch origin staging:staging
在檢查之前。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/528615.html
上一篇:gitconfiguser.name"FIRST_NAMELAST_NAME"將名稱準確地放在github用戶名上很重要嗎?
