Skip to content

Commit

Permalink
Merge pull request #12 from suda-morris/feature/add_dry_run_option
Browse files Browse the repository at this point in the history
feat(action): add dry_run option for upload validation (PACMAN-669)
  • Loading branch information
kumekay committed Jul 17, 2023
2 parents 998db93 + 784e04a commit cf84915
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.10-bullseye

RUN pip install "idf-component-manager~=1.2" "urllib3<2"
RUN pip install "idf-component-manager~=1.3"

COPY upload.sh /upload.sh

Expand Down
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 cf84915

Please sign in to comment.