如何从自定义操作的Dockerfile访问GitHub变量?
我有这个工作流yaml文件:
name: PHP code review
on: push
jobs:
phpunit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: PHPUnit
uses: ./.github/actions/phpunit
这是.github/action/phpunit/action.yml
file:
name: PHPUnit in Docker
description: Run PHPUnit in a custom configured Docker container
runs:
using: 'docker'
image: phpunit.dockerfile
这是dockerfile:
FROM ubuntu
# Update aptitude with new repo
RUN apt-get update
# Install software
RUN apt-get install -y git
# Clone the conf files into the docker container
RUN git clone https://${{ secrets.PHPUNIT_ACCESS_TOKEN }}@github.com/${{ GITHUB_REPOSITORY }}
但是在dockerfile中,它看起来像一个字符串,而不是可变的。
如何访问Dockerfile中的GitHub变量?
I have this workflow yaml file:
name: PHP code review
on: push
jobs:
phpunit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: PHPUnit
uses: ./.github/actions/phpunit
This is the .github/actions/phpunit/action.yml
file:
name: PHPUnit in Docker
description: Run PHPUnit in a custom configured Docker container
runs:
using: 'docker'
image: phpunit.dockerfile
And this is the Dockerfile:
FROM ubuntu
# Update aptitude with new repo
RUN apt-get update
# Install software
RUN apt-get install -y git
# Clone the conf files into the docker container
RUN git clone https://${{ secrets.PHPUNIT_ACCESS_TOKEN }}@github.com/${{ GITHUB_REPOSITORY }}
But in the Dockerfile it looks like a string, and not a variable.
How can I access to GitHub variables in my Dockerfile?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论