[英]mv: cannot stat './temp': No such file or directory on github actions
我制作了一個 github 工作流程,它獲取文件夾的內容並將其臨時存儲在另一個目錄中,它是這樣的:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create temp folder
run: |
cd ..
cp ./FlexLauncher ./temp -r
cd ./temp
ls
cd ..
- name: Move temp to main folder
run: |
mv ./temp ./FlexLauncher
ls
第一個 ls 的結果顯示該文件夾存在,因為我可以 cd 進入它並 ls 內容。
Run cd ..
cd ..
cp ./FlexLauncher ./temp -r
cd ./temp
ls
cd ..
shell: /usr/bin/bash -e {0}
README.md
main.js
main.py
package-lock.json
package.json
web
我在第二步中得到錯誤:
Run mv ./temp ./FlexLauncher
mv ./temp ./FlexLauncher
ls
shell: /usr/bin/bash -e {0}
mv: cannot stat './temp': No such file or directory
Error: Process completed with exit code 1.
查看 GitHub 操作的文檔:
每個
run
關鍵字代表 runner 環境中的一個新進程和 shell。 當您提供多行命令時,每行都運行在同一個 shell 中。
您可以使用“working-directory”屬性來指定應該執行腳本的文件夾:
- name: Create temp folder
working-directory: /your/path
run: |
cp ./FlexLauncher ./temp -r
cd ./temp
ls
- name: Move temp to main folder
working-directory: /your/path
run: |
mv ./temp ./FlexLauncher
ls
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.