我想使用 pandoc 從 Github Action 中的 Markdown 檔案生成 pdf。為此,我打算使用現有的 Docker 容器來提高性能。但不幸的是,我不能簡單地在本地ubuntu-latest和pandoc/latex:2.9添加相應的容器參考(洗掉第#6 行)之間切換。在這種情況下,我收到了沒有 pandoc 容器時不會發生的意外錯誤訊息。
name: Execute_pandoc
on: [push]
jobs:
Run_pandoc:
runs-on: ubuntu-latest
#container: pandoc/latex:2.16
steps:
- name: Illustrate the problem
run: |
echo "Hello World"
dirlist=(`ls *`)
Run echo "Hello World"
Hello World
/__w/_temp/2ac5de2c-2847-4b00-8a97-ba3bb034898e.sh: line 2: syntax error: unexpected "("
Error: Process completed with exit code 2.
uj5u.com熱心網友回復:
你得到的語法錯誤是因為 shell 不理解你的命令。嘗試設定不同的 shell 或更改命令。
請記住,pandoc/latex您的示例中的基本影像是alpine使用ash. 您可以簡單地使用另一個基于其他發行版的 pandoc 影像。
下面是一個例子:
name: Execute_pandoc
on: [push]
jobs:
Run_pandoc:
runs-on: ubuntu-latest
container: pandoc/ubuntu-latex
steps:
- name: Illustrate the problem
run: |
echo "Hello World"
dirlist=(`ls /*`)
echo ${dirlist[@]}
shell: bash
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/383898.html
