Skip to content

workflows/release-documentation: Submit a pull request with changes #108247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

tstellar
Copy link
Collaborator

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.

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.
@llvmbot
Copy link
Member

llvmbot commented Sep 11, 2024

@llvm/pr-subscribers-github-workflow

Author: Tom Stellard (tstellar)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/108247.diff

1 Files Affected:

  • (modified) .github/workflows/release-documentation.yml (+8-5)
diff --git a/.github/workflows/release-documentation.yml b/.github/workflows/release-documentation.yml
index 70e5f08b6f72e2..922c5093f13579 100644
--- a/.github/workflows/release-documentation.yml
+++ b/.github/workflows/release-documentation.yml
@@ -72,17 +72,20 @@ jobs:
           ref: main
           fetch-depth: 0
           path: www-releases
+          persist-credentials: false
 
       - name: Upload Release Notes
         if: env.upload
         env:
-          WWW_RELEASES_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }}
+          GH_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }}
         run: |
-          mkdir -p ../www-releases/${{ inputs.release-version }}
-          mv ./docs-build/html-export/* ../www-releases/${{ inputs.release-version }}
-          cd ../www-releases
+          mkdir -p www-releases/${{ inputs.release-version }}
+          mv ./docs-build/html-export/* www-releases/${{ inputs.release-version }}
+          cd www-releases
+          git checkout -b ${{ inputs.release-version }}
           git add ${{ inputs.release-version }}
           git config user.email "[email protected]"
           git config user.name "llvmbot"
           git commit -a -m "Add ${{ inputs.release-version }} documentation"
-          git push "https://[email protected]/${{ github.repository_owner }}/www-releases" main:main
+          git push --force  "https://[email protected]/llvmbot/www-releases.git" HEAD:refs/heads/${{ inputs.release-version }}
+          gh pr create -f -B main -H ${{ inputs.release-version }} -R llvmbot/www-releases

@tstellar
Copy link
Collaborator Author

Ping.

Copy link
Contributor

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable enough to me.

@tru should probably weigh in on this one though given I'm not that familiar with the release process.

Copy link
Collaborator

@tru tru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@tstellar tstellar merged commit 9cd289f into llvm:main Oct 1, 2024
8 checks passed
@tstellar tstellar added this to the LLVM 19.X Release milestone Oct 1, 2024
@tstellar
Copy link
Collaborator Author

tstellar commented Oct 1, 2024

/cherry-pick 9cd289f

llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Oct 1, 2024
…lvm#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)
@llvmbot
Copy link
Member

llvmbot commented Oct 1, 2024

/pull-request #110665

Sterling-Augustine pushed a commit to Sterling-Augustine/llvm-project that referenced this pull request Oct 3, 2024
…lvm#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.
tru pushed a commit to llvmbot/llvm-project that referenced this pull request Oct 11, 2024
…lvm#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)
tru pushed a commit to llvmbot/llvm-project that referenced this pull request Oct 11, 2024
…lvm#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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

4 participants