Skip to content

Commit

Permalink
Support copy with src-creds only, with dst-creds only or without cred…
Browse files Browse the repository at this point in the history
…entials
  • Loading branch information
spencercjh committed Dec 8, 2022
1 parent 353bbf4 commit 2a9a2b8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,19 @@ inputs:
runs:
using: "composite"
steps:
- run: skopeo copy --src-creds ${{ inputs.src-creds }} --dest-creds ${{ inputs.dst-creds }} docker://${{ inputs.src-image }} docker://${{ inputs.dst-image }}
- name: copy with src-creds only
if: ${{ inputs.src-creds != '' && inputs.dst-creds == '' }}
run: skopeo copy --src-creds ${{ inputs.src-creds }} docker://${{ inputs.src-image }} docker://${{ inputs.dst-image }}
shell: bash
- name: copy with dst-creds only
if: ${{ inputs.sre-creds == '' && inputs.dst-creds != '' }}
run: skopeo copy --dest-creds ${{ inputs.dst-creds }} docker://${{ inputs.src-image }} docker://${{ inputs.dst-image }}
shell: bash
- name: copy with src-creds and dst-creds
if: ${{ inputs.src-creds != '' && inputs.dst-creds != '' }}
run: skopeo copy --src-creds ${{ inputs.src-creds }} --dest-creds ${{ inputs.dst-creds }} docker://${{ inputs.src-image }} docker://${{ inputs.dst-image }}
shell: bash
- name: copy without credentials
if: ${{ inputs.src-creds == '' && inputs.dst-creds == '' }}
run: skopeo copy docker://${{ inputs.src-image }} docker://${{ inputs.dst-image }}
shell: bash

0 comments on commit 2a9a2b8

Please sign in to comment.