v2 test
This commit is contained in:
27
action.yml
27
action.yml
@@ -19,17 +19,26 @@ inputs:
|
||||
outputs:
|
||||
value:
|
||||
description: "The environement variable's value"
|
||||
value: ${{steps.worker.outputs.value}}
|
||||
value: ${{steps.extract-value.outputs.value}}
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: worker
|
||||
id: worker
|
||||
uses: addnab/docker-run-action@v3
|
||||
- name: login
|
||||
if: inputs.username != ''
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
image: ${{inputs.image}}
|
||||
registry: ${{inputs.registry}}
|
||||
username: ${{inputs.username}}
|
||||
password: ${{inputs.password}}
|
||||
run: echo "::set-output name=value::${${{inputs.name}}}"
|
||||
registry: ${{ inputs.registry}}
|
||||
username: ${{ inputs.username }}
|
||||
password: ${{ inputs.password }}
|
||||
- name: Pull Docker image
|
||||
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