Skip to content

Commit c3c1b04

Browse files
tstellartru
authored andcommitted
workflows/release-documentation: Submit a pull request with changes (#108247)
This is instead of pushing directly. Creating a pull request is slightly more work for the release manager, but it is more secure as we no longer need a secret with write access to the www-releases repo. (cherry picked from commit 9cd289f)
1 parent 7b27564 commit c3c1b04

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/release-documentation.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,20 @@ jobs:
7272
ref: main
7373
fetch-depth: 0
7474
path: www-releases
75+
persist-credentials: false
7576

7677
- name: Upload Release Notes
7778
if: env.upload
7879
env:
79-
WWW_RELEASES_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }}
80+
GH_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }}
8081
run: |
81-
mkdir -p ../www-releases/${{ inputs.release-version }}
82-
mv ./docs-build/html-export/* ../www-releases/${{ inputs.release-version }}
83-
cd ../www-releases
82+
mkdir -p www-releases/${{ inputs.release-version }}
83+
mv ./docs-build/html-export/* www-releases/${{ inputs.release-version }}
84+
cd www-releases
85+
git checkout -b ${{ inputs.release-version }}
8486
git add ${{ inputs.release-version }}
8587
git config user.email "[email protected]"
8688
git config user.name "llvmbot"
8789
git commit -a -m "Add ${{ inputs.release-version }} documentation"
88-
git push "https://[email protected]/${{ github.repository_owner }}/www-releases" main:main
90+
git push --force "https://[email protected]/llvmbot/www-releases.git" HEAD:refs/heads/${{ inputs.release-version }}
91+
gh pr create -f -B main -H ${{ inputs.release-version }} -R llvmbot/www-releases

0 commit comments

Comments
 (0)