Skip to content

Commit

Permalink
Merge pull request #104 from maikelpoot/zones
Browse files Browse the repository at this point in the history
Feature: Add zones input variable to optional sync a subset of zones in the configuration
  • Loading branch information
solvaholic authored Nov 4, 2024
2 parents c7fd61b + 6a866ef commit 4031e5e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
_config_path=$CONFIG_PATH
_doit=$DOIT
_force=$FORCE
_zones=$ZONES


# Run octodns-sync.
_logfile="${GITHUB_WORKSPACE}/octodns-sync.log"
Expand All @@ -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}:"
Expand Down

0 comments on commit 4031e5e

Please sign in to comment.