v2 test
This commit is contained in:
27
action.yml
27
action.yml
@@ -19,17 +19,26 @@ inputs:
|
|||||||
outputs:
|
outputs:
|
||||||
value:
|
value:
|
||||||
description: "The environement variable's value"
|
description: "The environement variable's value"
|
||||||
value: ${{steps.worker.outputs.value}}
|
value: ${{steps.extract-value.outputs.value}}
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: worker
|
- name: login
|
||||||
id: worker
|
if: inputs.username != ''
|
||||||
uses: addnab/docker-run-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
image: ${{inputs.image}}
|
registry: ${{ inputs.registry}}
|
||||||
registry: ${{inputs.registry}}
|
username: ${{ inputs.username }}
|
||||||
username: ${{inputs.username}}
|
password: ${{ inputs.password }}
|
||||||
password: ${{inputs.password}}
|
- name: Pull Docker image
|
||||||
run: echo "::set-output name=value::${${{inputs.name}}}"
|
shell: sh
|
||||||
|
run: docker pull ${{inputs.image}}
|
||||||
|
- name: Get variable value
|
||||||
|
id: extract-value
|
||||||
|
run: |
|
||||||
|
version=$(docker image inspect ${{inputs.image}} --format='{{range .Config.Env}}{{println .}}{{end}}' | grep ^${{inputs.name}}= | cut -d'=' -f2)
|
||||||
|
echo "${{inputs.name}}=$version"
|
||||||
|
echo "::set-output name=value::$version"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user