Skip to content

Commit

Permalink
feat(action): add dry_run option for upload validation
Browse files Browse the repository at this point in the history
  • Loading branch information
suda-morris committed Jul 14, 2023
1 parent 998db93 commit c8046bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ jobs:
| version | ✔ | | Version of the component, if not specified in the manifest. Should be a [semver](https://semver.org/) like `1.2.3` or `v1.2.3` |
| directories | ✔ | Repo root | Semicolon separated list of directories with components. |
| skip_pre_release | ✔ | False | Flag to skip [pre-release](https://semver.org/#spec-item-9) versions |
| dry_run | ✔ | False | Flag to upload a component for validation only without creating a version in the registry. |
| service_url | ✔ | https://components.espressif.com/api | (Deprecated) IDF Component registry API URL |
| registry_url | ✔ | https://components.espressif.com/ | IDF Component registry URL |
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ inputs:
skip_pre_release:
description: "Flag to skip pre-release versions. Set it to any non-empty string to skip pre-release versions."
required: false
dry_run:
description: "Upload component for validation without creating a version in the registry."
required: false
runs:
using: "docker"
image: "Dockerfile"
Expand All @@ -42,3 +45,4 @@ runs:
DEFAULT_COMPONENT_SERVICE_URL: ${{ inputs.service_url }}
IDF_COMPONENT_REGISTRY_URL: ${{ inputs.registry_url }}
SKIP_PRE_RELEASE: ${{ inputs.skip_pre_release }}
DRY_RUN: ${{ inputs.dry_run }}
3 changes: 3 additions & 0 deletions upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ UPLOAD_ARGUMENTS=("--allow-existing" "--namespace=${NAMESPACE}" )
if [ -n "$SKIP_PRE_RELEASE" ]; then
UPLOAD_ARGUMENTS+=("--skip-pre-release")
fi
if [ -n "$DRY_RUN" ]; then
UPLOAD_ARGUMENTS+=("--dry-run")
fi

if [ -n "$COMPONENT_VERSION" ]; then
if [ "$COMPONENT_VERSION" == "git" ]; then
Expand Down

0 comments on commit c8046bb

Please sign in to comment.