actions: support ent plugins in plugin update workflow (#28295)

This commit is contained in:
John-Michael Faircloth
2024-09-05 15:53:08 -05:00
committed by GitHub
parent 620430d236
commit b682a79551

View File

@@ -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"