From 94d8713de0b0be8ed471120109dc4ac516ff0b5a Mon Sep 17 00:00:00 2001 From: Maikel Poot Date: Fri, 11 Oct 2024 10:45:36 +0200 Subject: [PATCH 1/2] feat: Add zones input variable --- action.yml | 6 ++++++ scripts/run.sh | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f659064..c9802d1 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,11 @@ inputs: description: 'Run octodns-sync in force mode?' required: false default: 'No' + zones: + description: 'Space separated list of zones to sync, leave empty to sync + all zones in the config file' + required: false + default: '' pr_comment_token: description: 'Provide a token to use, if you set add_pr_comment to Yes.' required: true @@ -42,6 +47,7 @@ runs: CONFIG_PATH: ${{ inputs.config_path }} DOIT: ${{ inputs.doit }} FORCE: ${{ inputs.force }} + ZONES: ${{ inputs.zones }} run: ${{ github.action_path }}/scripts/run.sh shell: bash working-directory: ${{ github.workspace }} diff --git a/scripts/run.sh b/scripts/run.sh index 2dfa177..afd4bbc 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -10,6 +10,8 @@ _config_path=$CONFIG_PATH _doit=$DOIT _force=$FORCE +_zones=$ZONES + # Run octodns-sync. _logfile="${GITHUB_WORKSPACE}/octodns-sync.log" @@ -31,7 +33,7 @@ else _force= fi -if ! octodns-sync --config-file="${_config_path}" ${_doit} ${_force} \ +if ! octodns-sync --config-file="${_config_path}" ${_doit} ${_force} ${_zones} \ 1>"${_planfile}" 2>"${_logfile}"; then echo "FAIL: octodns-sync exited with an error." echo "FAIL: Here are the contents of ${_logfile}:" From 6a866ef33bda0c33a1fb1f1dc8aac31e72a22d26 Mon Sep 17 00:00:00 2001 From: Maikel Poot Date: Mon, 4 Nov 2024 13:03:01 +0100 Subject: [PATCH 2/2] chore(docs): Apply requested changes from PR review --- README.md | 6 ++++++ docs/CHANGELOG.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index a025388..615d272 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,12 @@ Provide a token to use, if you set `add_pr_comment` to "Yes". Default `"Not set"`. +### `zones` + +Space separated list of zones to sync, leave empty to sync all zones in the config file. + +Default: `""` (empty string) + ## Outputs ### plan diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f2c6dd7..b5b2645 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- ([#104](https://github.com/solvaholic/octodns-sync/pull/104)) Add input **zones** to allow syncing a subset of configured zones. + ## [3.0.1] - 2023-02-12 ### Added