diff --git a/README.md b/README.md index 3835f5d..8c8cfa8 100644 --- a/README.md +++ b/README.md @@ -19,21 +19,23 @@ 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 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' + env: + AWS_ACCESS_KEY_ID: ${{ secrets.route53_aws_key_id }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.route53_aws_secret_access_key }} ``` ## Inputs @@ -85,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 @@ -123,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/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/docs/CHANGELOG.md b/docs/CHANGELOG.md index 206272b..7008793 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -11,13 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### 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 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' 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