From 582defba8336f77138028c7352765f43089a69d2 Mon Sep 17 00:00:00 2001 From: "Roger D. Winans" Date: Wed, 12 Jan 2022 11:16:47 -0500 Subject: [PATCH 1/6] Add known issue to docs/CHANGELOG.md for #86 --- docs/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 206272b..f089660 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased ### Known issues + +- ([#86](https://github.com/solvaholic/octodns-sync/issues/86)) This Action does not work with extracted providers. + ### Added ### Changed From e87ec26dae0030f131f91117da71c22e15299dd6 Mon Sep 17 00:00:00 2001 From: "Roger D. Winans" Date: Sun, 23 Jan 2022 23:12:23 -0500 Subject: [PATCH 2/6] Revise example workflow in README to demonstrate installing requirements from config repo. /cc #89 --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3835f5d..32ca753 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,11 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - name: Publish - uses: solvaholic/octodns-sync@main + - uses: actions/setup-python@v2 + with: + python-version: '3.10' + - run: pip install -r requirements.txt + - uses: solvaholic/octodns-sync@main with: config_path: public.yaml doit: '--doit' From 25116cbe947d7c650759d57e644c096a010a4db8 Mon Sep 17 00:00:00 2001 From: "Roger D. Winans" Date: Sun, 23 Jan 2022 23:16:59 -0500 Subject: [PATCH 3/6] Move sensitive env into the step that needs it in README example workflow --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 32ca753..bfa8aea 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,6 @@ on: paths: - '*.yaml' -env: - AWS_ACCESS_KEY_ID: ${{ secrets.route53_aws_key_id }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.route53_aws_secret_access_key }} - jobs: publish: name: Publish DNS config from main @@ -37,6 +33,9 @@ jobs: with: config_path: public.yaml doit: '--doit' + env: + AWS_ACCESS_KEY_ID: ${{ secrets.route53_aws_key_id }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.route53_aws_secret_access_key }} ``` ## Inputs From 479712a0c572d27ad2783fb6144783a168623045 Mon Sep 17 00:00:00 2001 From: "Roger D. Winans" Date: Wed, 15 Jun 2022 18:52:26 -0400 Subject: [PATCH 4/6] Remove octodns_ref input and script/install.sh --- README.md | 6 ----- action.yml | 11 --------- scripts/install.sh | 57 ---------------------------------------------- 3 files changed, 74 deletions(-) delete mode 100755 scripts/install.sh diff --git a/README.md b/README.md index bfa8aea..a252d04 100644 --- a/README.md +++ b/README.md @@ -87,12 +87,6 @@ Provide a token to use, if you set `add_pr_comment` to "Yes". Default `"Not set"`. -### `octodns_ref` - -Select a release tag or a branch of octodns to use. For example "v0.9.14" or "awesome-feature". - -Default `"v0.9.14"`. - ## Outputs ### plan diff --git a/action.yml b/action.yml index 24a702d..819de32 100644 --- a/action.yml +++ b/action.yml @@ -17,10 +17,6 @@ inputs: not do it.' required: false default: '' - octodns_ref: - description: 'Select a release tag or a branch of octodns to use.' - required: true - default: 'v0.9.14' pr_comment_token: description: 'Provide a token to use, if you set add_pr_comment to Yes.' required: true @@ -33,13 +29,6 @@ outputs: runs: using: 'composite' steps: - - name: Install octodns/octodns and dependencies - id: install - env: - OCTODNS_REF: ${{ inputs.octodns_ref }} - run: ${{ github.action_path }}/scripts/install.sh - shell: bash - working-directory: ${{ github.action_path }} - name: Run octodns-sync id: run env: diff --git a/scripts/install.sh b/scripts/install.sh deleted file mode 100755 index 8527b42..0000000 --- a/scripts/install.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -# Install octodns and dependencies - -# Requires these, provided in action.yml: -# - OCTODNS_REF - -# Exit early if octodns is already installed -if command -v octodns-sync; then - echo "INFO: It looks like octodns is already installed." - exit 0 -fi - -# Set some variables -_ver="$OCTODNS_REF" -_src="$(mktemp -d)" -_api="https://api.github.com/repos/octodns/octodns/git/matching-refs" -_hdr="Accept: application/vnd.github.v3+json" -_via="" - -# Is _ver a valid pip version or Git ref? -if pip download -q "octodns==${_ver#v}"; then - # _ver is a PyPI version - _via=pip -elif curl -s -H "${_hdr}" "${_api}/tags/${_ver}"; then - # _ver is a tag in octodns/octodns - _via=git -elif curl -s -H "${_hdr}" "${_api}/heads/${_ver}"; then - # _ver is a branch in octodns/octodns - _via=git -else - # _ver is not a branch, tag, or PyPI version - echo "FAIL: Didn't find an octodns version '${_ver}'." - exit 1 -fi - -# Install octodns -if [ "${_via}" = "pip" ]; then - # Use pip to install octodns - _req="https://raw.githubusercontent.com/octodns/octodns/v${_ver#v}/requirements.txt" - if curl --output "${_src}/requirements.txt" "${_req}"; then - pip install "octodns==${_ver#v}" -r "${_src}/requirements.txt" - else - echo "FAIL: Error downloading requirements.txt." - fi -elif [ "${_via}" = "git" ]; then - # Use Git and then pip to install octodns - if git clone --single-branch --branch "${_ver}" --no-tags \ - https://github.com/octodns/octodns.git "${_src}"; then - pip install "${_src}" -r "${_src}/requirements.txt" - else - echo "FAIL: Error cloning octodns/octodns." - exit 1 - fi -else - echo "FAIL: How did this happen?" - exit 1 -fi From 00727d011ad9d4de78cd4bfd23cefc9b87144b1e Mon Sep 17 00:00:00 2001 From: "Roger D. Winans" Date: Wed, 15 Jun 2022 18:57:23 -0400 Subject: [PATCH 5/6] Update changelog per #89 --- docs/CHANGELOG.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f089660..7008793 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -8,19 +8,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased ### Known issues - -- ([#86](https://github.com/solvaholic/octodns-sync/issues/86)) This Action does not work with extracted providers. - ### Added ### Changed -- ([#85](https://github.com/solvaholic/octodns-sync/issues/85)) Change default **octodns/octodns** from v0.9.12 to v0.9.14. +- ([#86](https://github.com/solvaholic/octodns-sync/issues/86)) Remove `octodns_ref` input and installation script. ### Deprecated ### Removed ### Fixed - ([#41](https://github.com/solvaholic/octodns-sync/issues/41)) Document workaround for `add_pr_comment` adding a new comment for each run. +- ([#86](https://github.com/solvaholic/octodns-sync/issues/86)) This Action does not work with extracted providers. ### Security From ab2fd6afe72369c26e0c0e61b9fb88eda924993f Mon Sep 17 00:00:00 2001 From: "Roger D. Winans" Date: Sun, 19 Jun 2022 16:54:51 -0400 Subject: [PATCH 6/6] Catch up example workflows to indicate the correct procedure of pip installing octodns-sync from requirements.txt. --- README.md | 8 ++++++-- docs/add_pr_comment.md | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a252d04..8c8cfa8 100644 --- a/README.md +++ b/README.md @@ -119,10 +119,14 @@ on: pull_request: jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - uses: solvaholic/octodns-sync@latest + - uses: actions/setup-python@v2 + with: + python-version: '3.10' + - run: pip install -r requirements.txt + - uses: solvaholic/octodns-sync@main with: config_path: public.yaml add_pr_comment: 'Yes' diff --git a/docs/add_pr_comment.md b/docs/add_pr_comment.md index 172b376..ac85ce1 100644 --- a/docs/add_pr_comment.md +++ b/docs/add_pr_comment.md @@ -37,12 +37,16 @@ on: jobs: octodns-sync: name: Run `octodns-sync` with public.yaml - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 outputs: plan: ${{ steps.generate-plan.outputs.plan }} steps: - uses: actions/checkout@v2 - - uses: solvaholic/octodns-sync@v2.3.0 + - uses: actions/setup-python@v2 + with: + python-version: '3.10' + - run: pip install -r requirements.txt + - uses: solvaholic/octodns-sync@main id: generate-plan with: config_path: public.yaml @@ -52,7 +56,7 @@ jobs: add-pr-comment: name: Add `octodns-sync` plan to comment needs: [octodns-sync] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Find previous comment, if present uses: peter-evans/find-comment@v1.2.0 @@ -85,10 +89,14 @@ on: pull_request: jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - uses: solvaholic/octodns-sync@v2.3.0 + - uses: actions/setup-python@v2 + with: + python-version: '3.10' + - run: pip install -r requirements.txt + - uses: solvaholic/octodns-sync@main with: config_path: public.yaml add_pr_comment: 'Yes'