Skip to content

Commit 061a3a0

Browse files
committed
#2970: autoGen-talawa-admin-docs-debugging
1 parent ab2eee9 commit 061a3a0

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

.github/workflows/pull-request.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ jobs:
506506
repository: ${{ github.event.pull_request.head.repo.full_name }}
507507
ref: ${{ github.event.pull_request.head.ref }}
508508
fetch-depth: 0 # Required for getting full git history
509-
token: ${{ secrets.GITHUB_TOKEN }}
509+
PAT: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
510510

511511
- name: Setup Node.js
512512
uses: actions/setup-node@v4
@@ -562,8 +562,8 @@ jobs:
562562
563563
- name: Setup Git Config
564564
run: |
565-
git config user.name "GitHub Actions Bot"
566-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
565+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
566+
git config --local user.name "github-actions[bot]"
567567
568568
- name: Debug GitHub Variables
569569
run: |
@@ -583,21 +583,19 @@ jobs:
583583
env:
584584
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
585585
PR_REPO: ${{ github.event.pull_request.head.repo.full_name }}
586-
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
586+
PAT: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
587587
run: |
588-
set -e # Exit on error
589-
git remote set-url origin "https://[email protected]/$PR_REPO.git"
590-
git fetch origin "$PR_BRANCH"
591-
git checkout "$PR_BRANCH"
588+
# Set the remote URL with PAT for authentication
589+
git remote set-url origin https://${PAT}@github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}.git
590+
592591
git add docs/docs/auto-docs/
593592
git add docs/docs/developer-guide/
594593
git add docs/docs/user-guide/
594+
595595
if [[ -n "$(git status --porcelain)" ]]; then
596596
git commit -m "docs: update auto-generated documentation [skip ci]"
597-
if ! git push origin "HEAD:$PR_BRANCH"; then
598-
echo "Failed to push changes"
599-
exit 1
600-
fi
597+
# Use PAT in the push command
598+
git push "https://${PAT}@github.com/${{ github.event.pull_request.head.repo.full_name }}.git" HEAD:${{ github.head_ref }}
601599
else
602600
echo "No changes to commit"
603601
fi

0 commit comments

Comments
 (0)