Skip to content

Commit

Permalink
#2970: autoGen-talawa-admin-docs-debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
bint-Eve committed Jan 7, 2025
1 parent ab2eee9 commit 061a3a0
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0 # Required for getting full git history
token: ${{ secrets.GITHUB_TOKEN }}
PAT: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -562,8 +562,8 @@ jobs:
- name: Setup Git Config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Debug GitHub Variables
run: |
Expand All @@ -583,21 +583,19 @@ jobs:
env:
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
PR_REPO: ${{ github.event.pull_request.head.repo.full_name }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
PAT: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: |
set -e # Exit on error
git remote set-url origin "https://$GITHUB_TOKEN@github.com/$PR_REPO.git"
git fetch origin "$PR_BRANCH"
git checkout "$PR_BRANCH"
# Set the remote URL with PAT for authentication
git remote set-url origin https://${PAT}@github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}.git
git add docs/docs/auto-docs/
git add docs/docs/developer-guide/
git add docs/docs/user-guide/
if [[ -n "$(git status --porcelain)" ]]; then
git commit -m "docs: update auto-generated documentation [skip ci]"
if ! git push origin "HEAD:$PR_BRANCH"; then
echo "Failed to push changes"
exit 1
fi
# Use PAT in the push command
git push "https://${PAT}@github.com/${{ github.event.pull_request.head.repo.full_name }}.git" HEAD:${{ github.head_ref }}
else
echo "No changes to commit"
fi

0 comments on commit 061a3a0

Please sign in to comment.