diff --git a/.github/workflows/opentofu.yml b/.github/workflows/opentofu.yml index 25f6ecd..7bc4169 100644 --- a/.github/workflows/opentofu.yml +++ b/.github/workflows/opentofu.yml @@ -36,6 +36,8 @@ on: required: false SSH_KNOWN_HOSTS: required: false + NAMECHEAP_API_KEY: + required: false concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -198,6 +200,8 @@ jobs: known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} - name: OpenTofu Plan id: plan + env: + NAMECHEAP_API_KEY: ${{ secrets.NAMECHEAP_API_KEY }} run: | set -o pipefail export SHELLOPTS @@ -283,4 +287,6 @@ jobs: key: ${{ secrets.SSH_PRIVATE_KEY }} known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} - name: OpenTofu Apply + env: + NAMECHEAP_API_KEY: ${{ secrets.NAMECHEAP_API_KEY }} run: make apply diff --git a/README.md b/README.md index 16cd85d..b421989 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,21 @@ jobs: uses: makeitworkcloud/shared-workflows/.github/workflows/opentofu.yml@main ``` +### Namecheap + +Only repositories that manage Namecheap resources should map their repository +Actions secret into the reusable workflow secret: + +```yaml +jobs: + opentofu: + uses: makeitworkcloud/shared-workflows/.github/workflows/opentofu.yml@main + secrets: + NAMECHEAP_API_KEY: ${{ secrets.NAMECHEAP_API_KEY }} +``` + +Do not add this mapping for consumers that do not use Namecheap. + ## Available Workflows | Workflow | Description |