英文:
Need Jinja2 templates to work on Windows github runner
问题
I have the following file in my repo containing variables that should be evaluated after checkout.
cat infra/.env_qa
myname="Appone_${{ inputs.component }}"
port="8814"
server_list="{{ secrets.deploy_pass }}"
....
https://github.com/cuchi/jinja2-action
I use Jinja templates to generate a new file with the values as below:
- name: Setup env file
uses: cuchi/jinja2-action@v1.2.0
with:
template: infra/.env_qa.j2
output_file: infra/.env_qa
Unfortunately, this action runs only on Linux while I have a Windows runner.
I would like to know
- Alternate Jinja template action that runs on Windows
- How can I determine if an action is designed to run on Windows or not without running it.
英文:
I have the following file in my repo containing variables that should be evaluated after checkout.
cat infra/.env_qa
myname="Appone_${{ inputs.component }}"
port="8814"
server_list="{{ secrets.deploy_pass }}"
....
https://github.com/cuchi/jinja2-action
I use Jinja templates to generate a new file with the values as below:
- name: Setup env file
uses: cuchi/jinja2-action@v1.2.0
with:
template: infra/.env_qa.j2
output_file: infra/.env_qa
Unfortunately, this action runs only on Linux while I have a Windows runner.
I would like to know
- Alternate Jinja template action that runs on Windows
- How can I determine if an action is designed to run on Windows or not without running it.
答案1
得分: 1
-
可以在GitHub Actions Marketplace上搜索替代的 Jinja 模板操作。作为解决方法,您可以在单独的作业中在
ubuntu-latest
下运行该操作,将生成的文件上传为工件,然后在 Windows 作业下下载它。或者,您可以直接从命令行使用Jinja2。 -
如何确定某个操作是否设计为在Windows上运行,而不运行它?基于Docker的操作仅在Linux上受支持。您可以从它们的
action.yml
文件中识别它们,并查找runs
部分,例如这里。
英文:
> 1. Alternate Jinja template action that runs on Windows?
You can search on the GitHub Actions Marketplace.
As a workaround, you can run that action under ubuntu-latest
in a separate job, upload the generated file as an artifact, and then download it under your Windows job. Or, you can directly use Jinja2 from the command line.
> 2. How can I determine if an action is designed to run on Windows or not without running it?
Docker based actions are supported only on Linux. You can identify them from their action.yml
file and look for runs
section e.g. see here.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论