
name: 'Repo Star Count' description: 'Get count of Github repository stars' inputs: repoPath: description: 'Repository Path' required: false default: ${{github.repository}} outputs: stars: description: "Repo Stars" value: ${{ steps.repo-stars.outputs.stars }} runs: using: composite steps: - id: repo-stars run: | STARS=`curl -s 'https://api.github.com/repos/${{env.INPUT_REPOPATH}}?page=$i&per_page=100' | jq .stargazers_count` echo "::set-output name=stars::$STARS" shell: bash branding: icon: 'award' color: 'green' 代码如上,获取的 INPUT_REPOPATH 为空,按照官网所说为环境变量-INPUT_参数名字进行获取,但是却没拿到,姿势不对?
1 alanhe421 OP 解决了,但是按照官方的说法没有解决,说的是 env 也可以取到。。BUT,不行。 ${{ inputs.repoPath }} 可以取到值。 |
2 Rhilip 2021-06-14 09:54:37 +08:00 应该是不用写 env. 这个 prefix 的,直接 "$INPUT_FOO" 这种写法, 因为 ${{ env.foo }} 这种写法是给挂在 envs: 下面的变量准备的 |