Skip to content

workflows/release-documentation: Validate input and remove template expansion#199760

Open
tstellar wants to merge 2 commits into
llvm:mainfrom
tstellar:release-documentation-template
Open

workflows/release-documentation: Validate input and remove template expansion#199760
tstellar wants to merge 2 commits into
llvm:mainfrom
tstellar:release-documentation-template

Conversation

@llvmorg-github-actions
Copy link
Copy Markdown

@llvm/pr-subscribers-github-workflow

Author: Tom Stellard (tstellar)

Changes

https://github.com/llvm/llvm-project/security/code-scanning/1715 https://github.com/llvm/llvm-project/security/code-scanning/1716 https://github.com/llvm/llvm-project/security/code-scanning/1717 https://github.com/llvm/llvm-project/security/code-scanning/1718 https://github.com/llvm/llvm-project/security/code-scanning/1719 https://github.com/llvm/llvm-project/security/code-scanning/1720 https://github.com/llvm/llvm-project/security/code-scanning/1721 https://github.com/llvm/llvm-project/security/code-scanning/1722


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

1 Files Affected:

  • (modified) .github/workflows/release-documentation.yml (+16-8)
diff --git a/.github/workflows/release-documentation.yml b/.github/workflows/release-documentation.yml
index 75f6edc5cf078..ef32b811f624d 100644
--- a/.github/workflows/release-documentation.yml
+++ b/.github/workflows/release-documentation.yml
@@ -46,6 +46,11 @@ jobs:
         with:
           persist-credentials: false
 
+      - name: Validate Input
+        uses: ./.github/workflows/validate-release-version
+        with:
+          release-version: ${{ inputs.release-version }}
+
       - name: Setup Python env
         uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
         with:
@@ -65,8 +70,9 @@ jobs:
       - name: Build Documentation
         env:
           GITHUB_TOKEN: ${{ github.token }}
+          INPUTS_RELEASE_VERSION: ${{ inputs.release-version }}
         run: |
-          ./llvm/utils/release/build-docs.sh -release "${{ inputs.release-version }}" -no-doxygen
+          ./llvm/utils/release/build-docs.sh -release "$INPUTS_RELEASE_VERSION" -no-doxygen
 
       - name: Create Release Notes Artifact
         uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -89,14 +95,16 @@ jobs:
         env:
           PUSH_TOKEN: ${{ secrets.LLVMBOT_WWW_RELEASES_PUSH }}
           GH_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }}
+          INPUTS_RELEASE_VERSION: ${{ inputs.release-version }}
+        run: |
         run: |
-          mkdir -p www-releases/${{ inputs.release-version }}
-          mv ./docs-build/html-export/* www-releases/${{ inputs.release-version }}
+          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 checkout -b $INPUTS_RELEASE_VERSION
+          git add $INPUTS_RELEASE_VERSION
           git config user.email "llvmbot@llvm.org"
           git config user.name "llvmbot"
-          git commit -a -m "Add ${{ inputs.release-version }} documentation"
-          git push --force  "https://$PUSH_TOKEN@github.com/llvmbot/www-releases.git" HEAD:refs/heads/${{ inputs.release-version }}
-          gh pr create -f -B main -H llvmbot:${{ inputs.release-version }}
+          git commit -a -m "Add $INPUTS_RELEASE_VERSION documentation"
+          git push --force  "https://$PUSH_TOKEN@github.com/llvmbot/www-releases.git" HEAD:refs/heads/$INPUTS_RELEASE_VERSION
+          gh pr create -f -B main -H llvmbot:$INPUTS_RELEASE_VERSION

PUSH_TOKEN: ${{ secrets.LLVMBOT_WWW_RELEASES_PUSH }}
GH_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }}
INPUTS_RELEASE_VERSION: ${{ inputs.release-version }}
run: |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We now have two run lines?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed now, good catch.

Copy link
Copy Markdown
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.

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants