Skip to content

Commit

Permalink
Add skip_existing option to vcs_import action (#63)
Browse files Browse the repository at this point in the history
* Refs #20529: Add skip_existing option to vcs_import action

Signed-off-by: EduPonz <[email protected]>

* Refs #20529: Apply suggestions

Signed-off-by: EduPonz <[email protected]>

---------

Signed-off-by: EduPonz <[email protected]>
  • Loading branch information
EduPonz authored Feb 28, 2024
1 parent 5635236 commit 72e3bbb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
7 changes: 7 additions & 0 deletions multiplatform/vcs_import/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ inputs:
required: false
default: '${{ github.workspace }}'

skip_existing:
description: 'Skip existing repositories'
required: false
default: 'false'

runs:
using: composite
steps:
Expand All @@ -22,10 +27,12 @@ runs:
with:
vcs_repos_file: ${{ inputs.vcs_repos_file }}
destination_workspace: ${{ inputs.destination_workspace }}
skip_existing: ${{ inputs.skip_existing }}

- name: Run in windows
uses: eProsima/eProsima-CI/windows/vcs_import@main
if: runner.os == 'Windows'
with:
vcs_repos_file: ${{ inputs.vcs_repos_file }}
destination_workspace: ${{ inputs.destination_workspace }}
skip_existing: ${{ inputs.skip_existing }}
13 changes: 12 additions & 1 deletion ubuntu/vcs_import/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ inputs:
required: false
default: '${{ github.workspace }}'

skip_existing:
description: 'Skip existing repositories'
required: false
default: 'false'

runs:
using: composite
steps:
Expand All @@ -26,7 +31,13 @@ runs:
mkdir -p ${{ inputs.destination_workspace }}
vcs import ${{ inputs.destination_workspace }} < ${{ inputs.vcs_repos_file }}
SKIP_EXISTING=""
if [[ "${{ inputs.skip_existing }}" == "true" ]]
then
SKIP_EXISTING="--skip-existing"
fi
vcs import ${SKIP_EXISTING} ${{ inputs.destination_workspace }} < ${{ inputs.vcs_repos_file }}
echo "::endgroup::"
Expand Down
2 changes: 2 additions & 0 deletions versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The [Forthcoming](#forthcoming) section includes those features added in `main`

The upcoming release will include the following **features**:

- Support for skipping existing repositories in the `vcs_import` action.

## v0.9.0

This release includes the following **features**:
Expand Down
12 changes: 11 additions & 1 deletion windows/vcs_import/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ inputs:
required: false
default: '${{ github.workspace }}'

skip_existing:
description: 'Skip existing repositories'
required: false
default: 'false'

runs:
using: composite
steps:
Expand All @@ -24,6 +29,11 @@ runs:
New-Item -ItemType Directory -Path ${{ inputs.destination_workspace }} -Force
vcs import ${{ inputs.destination_workspace }} --input ${{ inputs.vcs_repos_file }}
$SKIP_EXISTING = $null
if ("${{ inputs.skip_existing }}" -eq "true") {
$SKIP_EXISTING = "--skip-existing"
}
vcs import $SKIP_EXISTING ${{ inputs.destination_workspace }} --input ${{ inputs.vcs_repos_file }}
"::endgroup::"

0 comments on commit 72e3bbb

Please sign in to comment.