Skip to content

Commit

Permalink
Merge pull request #4 from sumansaurabh/snorkell_ai/config
Browse files Browse the repository at this point in the history
[Snorkell.ai]: Setting up Automated AI-Driven Documentation for GitHub!
  • Loading branch information
sumansaurabh committed Oct 30, 2023
2 parents fb79d51 + 89d7b55 commit 5c93013
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/snorkell-auto-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will improvise current file with AI genereated documentation and Create new PR

name: Snorkell.ai - Revolutionizing Documentation on GitHub

on:
push:
branches: ["master"]
workflow_dispatch:

jobs:
Documentation:
runs-on: ubuntu-latest

steps:
- name: Extract branch name
shell: bash
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Run Script
shell: bash
run: |
ESCAPED_COMMIT_MSG=$(printf '%s\n' "${{ github.event.head_commit.message }}" | jq -R -s -c .)
echo "Escaped commit-msg: $ESCAPED_COMMIT_MSG"
echo "Commit Message: ${{ github.event.head_commit.message }}"
echo "PR Title: ${{ env.PR_TITLE }}"
echo "Repository: ${{ github.repository }}"
echo "Branch Name: ${{ env.BRANCH_NAME}}"
echo "Commit SHA: ${{ github.sha}}"
curl --max-time 600 -X POST -H 'api-key: ${{ secrets.SNORKELL_API_KEY }}' -H 'Content-Type: application/json' \
-d '{"installation_id": "${{ secrets.SNORKELL_CLIENT_ID }}", "full_repo_name": "${{ github.repository }}", "base_branch": "${{ env.BRANCH_NAME }}", "commit_sha": "${{ github.sha }}", "commit_message": '"$ESCAPED_COMMIT_MSG"'}' \
https://production-gateway.snorkell.ai/api/app/github/generate/documentation || echo "Curl failed with exit code: $?"

0 comments on commit 5c93013

Please sign in to comment.