diff --git a/.github/workflows/deploy-bundle-preview.yml b/.github/workflows/deploy-bundle-preview.yml index 1381194a..77ed0ac5 100644 --- a/.github/workflows/deploy-bundle-preview.yml +++ b/.github/workflows/deploy-bundle-preview.yml @@ -16,7 +16,7 @@ jobs: - name: Configure Git Credentials uses: de-vri-es/setup-git-credentials@v2 with: - credentials: ${{ secrets.GIT_CREDENTIALS }} + credentials: https://${{ secrets.DOCS_GITHUB_PAT }}@github.com - name: Checkout Repository uses: actions/checkout@v4 @@ -56,7 +56,7 @@ jobs: if: ${{ success() && github.event.pull_request.number }} uses: peter-evans/create-or-update-comment@v3 with: - token: ${{ secrets.COMMENT_GITHUB_TOKEN }} + token: ${{ secrets.DOCS_GITHUB_PAT }} issue-number: ${{ github.event.pull_request.number }} body: | UI bundle preview build successful! :white_check_mark: @@ -67,7 +67,7 @@ jobs: if: ${{ failure() && github.event.pull_request.number }} uses: peter-evans/create-or-update-comment@v3 with: - token: ${{ secrets.COMMENT_GITHUB_TOKEN }} + token: ${{ secrets.DOCS_GITHUB_PAT }} issue-number: ${{ github.event.pull_request.number }} body: | UI bundle preview build failure! :x: @@ -79,15 +79,17 @@ jobs: uses: peter-evans/find-comment@v2 id: fc with: - token: ${{ secrets.COMMENT_GITHUB_TOKEN }} + token: ${{ secrets.DOCS_GITHUB_PAT }} issue-number: ${{ github.event.pull_request.number }} - comment-author: 'mlr' body-includes: UI bundle preview build successful! direction: last - name: Deploy to GitHub Pages if: success() run: | + # Configure git to use the PAT for cloning and pushing to the gh-pages branch + git config --global url.https://${{ secrets.DOCS_GITHUB_PAT }}@github.com/.insteadOf https://github.com/ + git clone https://github.com/$GITHUB_REPOSITORY.git pages cd pages git checkout gh-pages @@ -116,7 +118,7 @@ jobs: sleep 5 # Allow time for build to initiate build_url=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.COMMENT_GITHUB_TOKEN }}" \ + -H "Authorization: Bearer ${{ secrets.DOCS_GITHUB_PAT }}" \ -H "X-GitHub-Api-Version: 2022-11-28" 'https://api.github.com/repos/${{ github.event.repository.full_name }}/pages/builds/latest' \ | jq -r .url) echo "url=$build_url" >> $GITHUB_OUTPUT @@ -128,7 +130,7 @@ jobs: for i in {1..60}; do build_status=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.COMMENT_GITHUB_TOKEN }}" \ + -H "Authorization: Bearer ${{ secrets.DOCS_GITHUB_PAT }}" \ -H "X-GitHub-Api-Version: 2022-11-28" '${{ steps.ghpages_build.outputs.url }}' \ | jq -r .status) @@ -153,7 +155,7 @@ jobs: if: ${{ steps.fc.outputs.comment-id != '' }} uses: peter-evans/create-or-update-comment@v3 with: - token: ${{ secrets.COMMENT_GITHUB_TOKEN }} + token: ${{ secrets.DOCS_GITHUB_PAT }} comment-id: ${{ steps.fc.outputs.comment-id }} body: | Deployment successful! [View preview](${{ steps.draft_url.outputs.url }}) diff --git a/.github/workflows/release-ui-bundle.yml b/.github/workflows/release-ui-bundle.yml index 0e315088..b216fabc 100644 --- a/.github/workflows/release-ui-bundle.yml +++ b/.github/workflows/release-ui-bundle.yml @@ -16,7 +16,7 @@ jobs: - name: Configure Git Credentials uses: de-vri-es/setup-git-credentials@v2 with: - credentials: ${{ secrets.GIT_CREDENTIALS }} + credentials: https://${{ secrets.DOCS_GITHUB_PAT }}@github.com - name: Checkout Repository uses: actions/checkout@v4 @@ -25,8 +25,6 @@ jobs: - name: Check Last Commit Message id: skip_release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | last_commit_message=$(git log -1 --pretty=%B) if [[ $last_commit_message == *"[no-release]"* ]]; then