From 535ab3bad7ae9cdee1dfd7b765060a9f29c4abd1 Mon Sep 17 00:00:00 2001 From: Sarah Chavis <62406755+schavis@users.noreply.github.com> Date: Fri, 10 Oct 2025 13:01:02 -0700 Subject: [PATCH 1/4] Add action to create a PR that renamed preview folders --- .github/workflows/create-ga-pr.yml | 81 ++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/create-ga-pr.yml diff --git a/.github/workflows/create-ga-pr.yml b/.github/workflows/create-ga-pr.yml new file mode 100644 index 0000000000..f78656b88b --- /dev/null +++ b/.github/workflows/create-ga-pr.yml @@ -0,0 +1,81 @@ +name: 📁 Create GA PR +run-name: Create GA PR [${{ github.actor }}] + +permissions: + pull-requests: write + contents: write + +on: + workflow_dispatch: + inputs: + targetVersion: + required: true + description: Preview version (e.g., "1.21.x") + default: '' + folderTag: + required: true + default: '' + description: Preview dog tag (e.g., 'rc' or 'beta') + product: + required: true + default: '' + description: Product slug (e.g., 'vault') + +env: + prBranch: "${{ github.event.inputs.product }}/${{ github.event.inputs.targetVersion }}-to-ga" + oldFolder: "v${{ github.event.inputs.targetVersion }} (${{ github.event.inputs.folderTag }})" + newFolder: "v${{ github.event.inputs.targetVersion }}" + + +jobs: + + update-folder: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Check out main + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Configure Git User + run: | + git config user.name "GitHub Actions" + git config user.email "github-actions@github.com" + - name: Update preview folder + working-directory: ./content/${{ github.event.inputs.product }} + run: | + git pull origin main + git checkout -B "${{ env.prBranch }}" + mv "./${{ env.oldFolder }}" "./${{ env.newFolder }}" + git add . + git commit -m "Rename ${{ env.oldFolder }}" + git push --force -u origin "${{ env.prBranch }}" + + create-pr: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + prTitle: "[PUBLISH GA] Convert ${{ github.event.inputs.targetVersion }} to GA" + prBody: | + 🚧 \`${{ github.repository }}\` publication PR + + **Triggered by**: @${{ github.actor }} with a Github action + **Preview folder**: \`${{ github.event.inputs.product }}/v${{ github.event.inputs.targetVersion }} (${{ github.event.inputs.folderTag }})\` + **New folder**: \`${{ github.event.inputs.product }}/v${{ github.event.inputs.targetVersion }}\` + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + ref: ${{ env.prBranch }} + fetch-depth: 0 + - name: Create pull request + run: | + gh pr create \ + --base main \ + --head ${{ env.prBranch }} \ + --title "${{ env.prTitle }}" \ + --body "${{ env.prBody }}" + - name: Wrap-up + run: | + echo "🍏 Final job status: ${{ job.status }}" From c8dda23875eb5e9e60b754f0f4e9aa6db247ba92 Mon Sep 17 00:00:00 2001 From: Sarah Chavis <62406755+schavis@users.noreply.github.com> Date: Tue, 14 Oct 2025 13:34:24 -0700 Subject: [PATCH 2/4] Update .github/workflows/create-ga-pr.yml Co-authored-by: Ruben Nic --- .github/workflows/create-ga-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-ga-pr.yml b/.github/workflows/create-ga-pr.yml index f78656b88b..d1446e384a 100644 --- a/.github/workflows/create-ga-pr.yml +++ b/.github/workflows/create-ga-pr.yml @@ -41,7 +41,7 @@ jobs: - name: Configure Git User run: | git config user.name "GitHub Actions" - git config user.email "github-actions@github.com" + git config user.email "team-rel-eng@hashicorp.com" - name: Update preview folder working-directory: ./content/${{ github.event.inputs.product }} run: | From dc2f728842c340bde268cc9ed01a34f188bfa44b Mon Sep 17 00:00:00 2001 From: Sarah Chavis <62406755+schavis@users.noreply.github.com> Date: Tue, 14 Oct 2025 13:34:32 -0700 Subject: [PATCH 3/4] Update .github/workflows/create-ga-pr.yml Co-authored-by: Ruben Nic --- .github/workflows/create-ga-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-ga-pr.yml b/.github/workflows/create-ga-pr.yml index d1446e384a..507188a642 100644 --- a/.github/workflows/create-ga-pr.yml +++ b/.github/workflows/create-ga-pr.yml @@ -35,7 +35,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Check out main - uses: actions/checkout@v4 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: fetch-depth: 0 - name: Configure Git User From f113bc7baf9e978531faf6b97a08e06e016c2515 Mon Sep 17 00:00:00 2001 From: Sarah Chavis <62406755+schavis@users.noreply.github.com> Date: Tue, 14 Oct 2025 13:34:42 -0700 Subject: [PATCH 4/4] Update .github/workflows/create-ga-pr.yml Co-authored-by: Ruben Nic --- .github/workflows/create-ga-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-ga-pr.yml b/.github/workflows/create-ga-pr.yml index 507188a642..f6b7baa2eb 100644 --- a/.github/workflows/create-ga-pr.yml +++ b/.github/workflows/create-ga-pr.yml @@ -65,7 +65,7 @@ jobs: **New folder**: \`${{ github.event.inputs.product }}/v${{ github.event.inputs.targetVersion }}\` steps: - name: Check out repository code - uses: actions/checkout@v4 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: ref: ${{ env.prBranch }} fetch-depth: 0