Skip to content
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

Auto docs #3290

Open
wants to merge 14 commits into
base: develop-postgres
Choose a base branch
from
33 changes: 19 additions & 14 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##############################################################################

Check warning on line 1 in .github/workflows/pull-request.yml

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.
##############################################################################
#
# NOTE!
Expand Down Expand Up @@ -419,17 +419,14 @@

generate-docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}

- name: Check Repository URL
run: |
echo "Repository URL: ${{ github.event.pull_request.head.repo.full_name }}"
echo "Branch: ${{ github.head_ref }}"
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v4
Expand All @@ -443,14 +440,22 @@
run: npm run generate-docs

- name: Commit and Push Changes
run: |
git config user.name "github-actions[bot]"
git config user.email "${{ github.event.pull_request.user.id }}+${{ github.event.pull_request.user.login }}@users.noreply.github.com" git add .
git commit -m "Auto-generate documentation"
git push origin HEAD:${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

HEAD_REF: ${{ github.head_ref }}
run: |
if [[ $(git status --porcelain) ]]; then
echo "Changes detected. Auto-committing updates."
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
gautam-divyanshu marked this conversation as resolved.
Show resolved Hide resolved
git commit -m "Auto-generate documentation"
if ! git push origin HEAD:"$HEAD_REF"; then
echo "Failed to push changes. Please check if you have the correct permissions."
exit 1
fi
else
echo "No changes detected."
fi
Test-Docusaurus-Deployment:
name: Test Deployment to https://docs-admin.talawa.io
runs-on: ubuntu-latest
Expand Down
Loading