Skip to content

Commit

Permalink
fix: fixed docs generation in release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nickytonline committed Sep 9, 2024
1 parent 54cf017 commit 5fb0f1f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,9 @@ jobs:
uses: extractions/setup-just@v2

- name: "📗 Generate Documentation"
run: |
just gen-docs
git config user.name 'open-sauced[bot]'
git config user.email '63161813+open-sauced[bot]@users.noreply.github.com'
git add docs/
git commit -m "chore: automated docs generation for release" || echo "No changes to commit"
git push origin HEAD:${{ github.ref }}
run: ./scripts/generate-docs.sh
env:
GITHUB_REF: ${{ github.ref }}

- name: "🔧 Build all and upload artifacts to release"
env:
Expand Down
24 changes: 24 additions & 0 deletions scripts/generate-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# Exit immediately if a command exits with a non-zero status.
set -e

# Configure git to use the OpenSauced bot account
git config user.name 'open-sauced[bot]'
git config user.email '63161813+open-sauced[bot]@users.noreply.github.com'

# Semantic release made changes, so pull the latest changes from the current branch
git pull origin "$GITHUB_REF"

# Generate documentation
just gen-docs

# Get the author of the last non-merge commit
LAST_COMMIT_AUTHOR=$(git log -1 --no-merges --pretty=format:'%an <%ae>')

# Commit with co-authorship and push changes
git add docs/
git commit -m "chore: automated docs generation for release
Co-authored-by: $LAST_COMMIT_AUTHOR" || echo "No changes to commit"
git push origin HEAD:"$GITHUB_REF"

0 comments on commit 5fb0f1f

Please sign in to comment.