【问题标题】:How do I get php ini-value in github actions to point towards a file in my project directory如何在 github 操作中获取 php ini-value 以指向我的项目目录中的文件
【发布时间】:2020-12-01 13:46:37
【问题描述】:

这是我用于 github 操作的 .yml 文件。如何正确添加ini-values 参数以指向我项目中的目录?我的项目结构是InstaGetSymfony/src = symfony MVC dir。

我希望我的curl.cainfoini 值指向InstaGetSymfony/ca/cacert.pem

name: InstaGet

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  run:
    
    runs-on: ubuntu-latest
    
    steps:
    - name: Checkout codebase
      uses: actions/checkout@v2

    - name: Setup PHP with pecl extension
      uses: shivammathur/setup-php@v2
      with:
        php-version: '7.4'
        tools: pecl
        extensions: curl
        ini-values: curl.cainfo=/home/runner/work/InstaGetSymfony/InstaGetSymfony/ca/cacert.pem

    - name: Validate composer.json and composer.lock
      run: composer validate

    - name: Install dependencies
      run: composer install

    - name: Run phing
      run: vendor/bin/phing

【问题讨论】:

    标签: php github-actions


    【解决方案1】:

    您可以在上一步中获取目录并使用它。

    - name: Get current directory
      id: pwd
      run: echo "::set-output name=pwd::$(pwd)"
    
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '7.4'
        ini-values: curl.cainfo=${{ steps.pwd.outputs.pwd }}/ca/cacert.pem
    

    默认情况下还可以使用 curl 扩展,并且此工作流程不需要 pecl,因此您可以删除它们。

    【讨论】:

      猜你喜欢
      • 2021-04-05
      • 1970-01-01
      • 2015-07-03
      • 1970-01-01
      • 2012-11-19
      • 2011-10-05
      • 2013-06-16
      • 2012-07-20
      • 1970-01-01
      相关资源
      最近更新 更多