From b682a79551d19aaaf9a085ec9f20aca391f82735 Mon Sep 17 00:00:00 2001 From: John-Michael Faircloth Date: Thu, 5 Sep 2024 15:53:08 -0500 Subject: [PATCH] actions: support ent plugins in plugin update workflow (#28295) --- .github/workflows/plugin-update.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/plugin-update.yml b/.github/workflows/plugin-update.yml index 55469104f0..0e3f2551a9 100644 --- a/.github/workflows/plugin-update.yml +++ b/.github/workflows/plugin-update.yml @@ -39,12 +39,19 @@ jobs: cache: false # save cache space for vault builds: https://github.com/hashicorp/vault/pull/21764 go-version-file: .go-version - - name: update plugin + - name: Update plugin + if: github.repository == 'hashicorp/vault' run: | go get "github.com/hashicorp/${{ inputs.plugin }}@v${{ inputs.version }}" go mod tidy - - name: detect changes + - name: Update Enterprise-only plugin + if: github.repository == 'hashicorp/vault-enterprise' + run: | + (cd vault_ent && go get "github.com/hashicorp/${{ inputs.plugin }}@v${{ inputs.version }}" && go mod tidy) + go mod tidy + + - name: Detect changes run: | count=$(git status --porcelain=v1 2>/dev/null | wc -l) if [ "$count" -eq 0 ]; then @@ -52,7 +59,7 @@ jobs: exit 1 fi - - name: commit/push + - name: Commit and push run: | git config user.name hc-github-team-secure-vault-ecosystem git config user.email hc-github-team-secure-vault-ecosystem@users.noreply.github.com @@ -72,8 +79,9 @@ jobs: gh pr create \ --head "$VAULT_BRANCH" \ --reviewer "$REVIEWER" \ + --assignee "$REVIEWER" \ --title "Update ${{ inputs.plugin }} to v${{ inputs.version }}" \ - --body "This PR was generated by a GitHub Action. Full log: https://github.com/hashicorp/vault/actions/runs/${{ github.run_id }}" + --body "This PR was generated by a GitHub Action. Full log: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" echo "vault_pr_num=$(gh pr list --head "$VAULT_BRANCH" --json number -q '.[0].number')" >> "$GITHUB_OUTPUT" echo "vault_pr_url=$(gh pr list --head "$VAULT_BRANCH" --json url -q '.[0].url')" >> "$GITHUB_OUTPUT"