From abaa8317b5c4247cf1f0047765f0ecd659cc8ab1 Mon Sep 17 00:00:00 2001 From: Florian Blampey Date: Mon, 8 Apr 2024 09:58:00 +0200 Subject: [PATCH] harbor_replication documentation bug (fixes #424) (#425) Signed-off-by: flbla Co-authored-by: github-actions[bot] --- .github/workflows/tfplugindocs-check.yml | 8 --- .github/workflows/tfplugindocs-generate.yml | 51 +++++++++++++++++++ docs/resources/replication.md | 2 +- .../resources/harbor_replication/resource.tf | 2 +- 4 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/tfplugindocs-generate.yml diff --git a/.github/workflows/tfplugindocs-check.yml b/.github/workflows/tfplugindocs-check.yml index cb35bc7..1c6ffd7 100644 --- a/.github/workflows/tfplugindocs-check.yml +++ b/.github/workflows/tfplugindocs-check.yml @@ -7,14 +7,6 @@ on: branches: - main - "release/**" - pull_request: - paths: - - .github/workflows/tfplugindocs-check.yml - - go.sum - - Makefile - - client/** - - main.go - - docs/** jobs: tfplugindocs_check: diff --git a/.github/workflows/tfplugindocs-generate.yml b/.github/workflows/tfplugindocs-generate.yml new file mode 100644 index 0000000..20eb001 --- /dev/null +++ b/.github/workflows/tfplugindocs-generate.yml @@ -0,0 +1,51 @@ +# source https://github.com/hashicorp/terraform-provider-awscc/blob/main/.github/workflows/tfplugindocs-check.yml + +name: Generate tfplugindocs /docs + +on: + pull_request: + paths: + - .github/workflows/tfplugindocs-check.yml + - Makefile + - docs/** + - examples/** + - templates/** + +jobs: + tfplugindocs_generate: + name: tfplugindocs generate + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + with: + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token + fetch-depth: 0 # otherwise, you will failed to push refs to dest repo + - uses: actions/setup-go@v5.0.0 + with: + go-version-file: tools/go.mod + - name: GOCACHE + run: | + echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV + - uses: actions/cache@v4.0.0 + continue-on-error: true + timeout-minutes: 2 + with: + # TODO: Replace with supported mechanism when it is supported + # https://github.com/actions/setup-go/issues/54 + path: ${{ env.GOCACHE }} + key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} + - uses: actions/cache@v4.0.0 + continue-on-error: true + timeout-minutes: 2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} + - run: | + make tools + make docs + - uses: actions-js/push@v1.4 + name: Github commit and push + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.head_ref }} + message: "[bot][skip ci] docs: tfplugindocs generate" \ No newline at end of file diff --git a/docs/resources/replication.md b/docs/resources/replication.md index 9faf9a1..bf80b55 100644 --- a/docs/resources/replication.md +++ b/docs/resources/replication.md @@ -47,7 +47,7 @@ resource "harbor_replication" "alpine" { resource "harbor_replication" "alpine" { name = "alpine" - action = "pull" + action = "push" registry_id = harbor_registry.main.registry_id schedule = "event_based" filters { diff --git a/examples/resources/harbor_replication/resource.tf b/examples/resources/harbor_replication/resource.tf index 999e638..55e0c1c 100644 --- a/examples/resources/harbor_replication/resource.tf +++ b/examples/resources/harbor_replication/resource.tf @@ -32,7 +32,7 @@ resource "harbor_replication" "alpine" { resource "harbor_replication" "alpine" { name = "alpine" - action = "pull" + action = "push" registry_id = harbor_registry.main.registry_id schedule = "event_based" filters {