1414 required : true
1515 type : string
1616 outputs :
17- docs_branch_name :
17+ release_branch_name :
1818 description : ' The name of the branch created for the new TFE version docs.'
19- value : ${{ jobs.copy-docs.outputs.docs_branch_name }}
19+ value : ${{ jobs.copy-docs.outputs.release_branch_name }}
20+ release_branch_pr_url :
21+ description : ' The URL of the release branch created for the new TFE version docs.'
22+ value : ${{ jobs.copy-docs.outputs.release_branch_pr_url }}
23+ diff_branch_pr_url :
24+ description : ' The URL of the diff branch created for the new TFE version docs.'
25+ value : ${{ jobs.copy-docs.outputs.diff_branch_pr_url }}
2026
2127jobs :
2228 copy-docs :
2329 name : Copy Docs
2430 runs-on : ubuntu-latest
2531 outputs :
26- docs_branch_name : ${{ steps.open-docs-pr.outputs.docs_branch_name }}
32+ release_branch_name : ${{ steps.open-docs-pr.outputs.docs_branch_name }}
33+ release_branch_pr_url : ${{ steps.open-docs-pr.outputs.release_branch_pr_url }}
34+ diff_branch_pr_url : ${{ steps.open-diff-pr.outputs.diff_branch_pr_url }}
2735 steps :
2836 - name : Series/Release Summary
2937 run : |
@@ -49,15 +57,21 @@ jobs:
4957
5058 - name : Create the new TFE version folder for RELEASE PR
5159 run : |
60+ prev_version=$(jq -r '.["terraform-enterprise"][] | select(.isLatest == true) | .version' "${{github.workspace}}/new-docs-pr/app/api/versionMetadata.json")
61+ echo "Previous terraform-enterprise version: ${prev_version}"
62+ echo "PREV_TFE_VERSION=${prev_version}" >> $GITHUB_ENV
63+
5264 mkdir -p "${{github.workspace}}/new-docs-pr/content/terraform-enterprise/${{inputs.version}}"
5365
54- - name : Open new version DOCS PR
66+ cp -a "${{github.workspace}}/new-docs-pr/content/terraform-enterprise/${prev_version}/." "${{github.workspace}}/new-docs-pr/content/terraform-enterprise/${{inputs.version}}"
67+
68+ - name : Open new version RELEASE PR
5569 id : open-docs-pr
5670 working-directory : ' ${{github.workspace}}/new-docs-pr'
5771 env :
58- docs_branch_name : docs /${{inputs.version}}
72+ docs_branch_name : tfe-release /${{inputs.version}}
5973 docs_pr_body : |
60- # Automated Docs Release PR for TFE ${{inputs.version}}
74+ # TFE Release ${{inputs.version}}
6175
6276 ...Waiting for the diff PR to be created, before finishing this PR's description...
6377
@@ -78,20 +92,21 @@ jobs:
7892 git checkout -b ${{env.docs_branch_name}}
7993 git add .
8094
81- git commit -m "Automated Release Docs PR " --no-verify
95+ git commit -m "TFE Release ${{inputs.version}} " --no-verify
8296 git push origin HEAD
8397
8498 gh pr create \
8599 --body="${{env.docs_pr_body}}" \
86- --title="Automated Docs Release PR for TFE ${{inputs.version}}" \
100+ --title="TFE Release ${{inputs.version}}" \
87101 --draft \
88102 --head ${{env.docs_branch_name}} \
89103 --base main
90104
91105 echo "docs_branch_name=${{env.docs_branch_name}}" >> $GITHUB_OUTPUT
92106 docs_pr_url=$(gh pr view --json url --jq '.url')
93107 echo "DOCS_PR_URL=${docs_pr_url}" >> $GITHUB_ENV
94- echo "**Automated Docs PR URL**: ${docs_pr_url}" >> $GITHUB_STEP_SUMMARY
108+ echo "release_branch_pr_url=${docs_pr_url}" >> $GITHUB_OUTPUT
109+ echo "**TFE Release PR URL**: ${docs_pr_url}" >> $GITHUB_STEP_SUMMARY
95110
96111 # MAKE THE DIFF PR
97112 - name : Checkout main for new docs version DIFF PR
@@ -101,19 +116,20 @@ jobs:
101116 ref : ' ${{steps.open-docs-pr.outputs.docs_branch_name}}'
102117
103118 - name : Copy files for new docs version DIFF PR
104- uses : ./release /.github/actions/copy-cloud-docs-for-tfe
119+ uses : ./new-docs-pr /.github/actions/copy-cloud-docs-for-tfe
105120 with :
106121 source_path : ' ${{github.workspace}}/new-docs-pr'
107122 target_path : ' ${{github.workspace}}/new-docs-diff-pr'
108123 new_TFE_version : ${{inputs.version}}
109124
110125 - name : Open new docs version DIFF PR
126+ id : open-diff-pr
111127 working-directory : ' ${{github.workspace}}/new-docs-diff-pr'
112128 env :
113129 docs_branch_name : ${{steps.open-docs-pr.outputs.docs_branch_name}}
114- diff_branch_name : docs -diff/${{inputs.version}}
130+ diff_branch_name : HCPTF -diff/${{inputs.version}}
115131 diff_pr_body : |
116- # Automated Docs Diff PR for TFE ${{inputs.version}}
132+ # HCP TF changes for TFE release ${{inputs.version}}
117133
118134 This PR was created via:
119135 - ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}
@@ -144,31 +160,34 @@ jobs:
144160 git checkout -b ${{env.diff_branch_name}}
145161 git add .
146162
147- git commit -m "Automated Docs Diff PR " --no-verify
163+ git commit -m "HCP TF changes for TFE release " --no-verify
148164 git push origin HEAD
149165
150166 gh pr create \
151167 --body="${{env.diff_pr_body}}" \
152- --title="Automated Docs Diff PR for TFE ${{inputs.version}}" \
168+ --title="HCP TF changes for TFE release ${{inputs.version}}" \
153169 --draft \
154170 --head ${{env.diff_branch_name}} \
155171 --base ${{env.docs_branch_name}}
156172
157173 diff_pr_url=$(gh pr view --json url --jq '.url')
158174 echo "DIFF_PR_URL=${diff_pr_url}" >> $GITHUB_ENV
159- echo "**Automated DIFF PR URL**: ${diff_pr_url}" >> $GITHUB_STEP_SUMMARY
175+ echo "diff_branch_pr_url=${diff_pr_url}" >> $GITHUB_OUTPUT
176+ echo "**HCP TF changes for TFE release PR URL**: ${diff_pr_url}" >> $GITHUB_STEP_SUMMARY
160177
161- - name : Update DOCS PR with DIFF PR URL
178+ - name : Update RELEASE PR with DIFF PR URL
162179 env :
163180 docs_pr_body : |
164- # Automated Docs Release PR for TFE ${{inputs.version}}
181+ # TFE Release ${{inputs.version}}
165182
166183 This PR was created via:
167184 - ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}
168185
169186 Changes since last release, diff PR:
170187 - ${{ env.DIFF_PR_URL }}
171188
189+ ❗ This is the Release PR that will be merged into main, once the release notes and diff PR are merged into it. ❗
190+
172191 ### Reviewers
173192 - [ ] @hashicorp/ptfe-review
174193 - [ ] @hashicorp/web-platform
0 commit comments