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

fix: fixed docs generation in release workflow #162

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
jpmcb marked this conversation as resolved.
Show resolved Hide resolved
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"
Loading