Merge pull request #10 from soerenschneider/dependabot/github_actions… #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: cobra | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.1.0 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' | |
- name: build binary | |
run: make build | |
# this makes sure that no cobra flags are wrongly assigned | |
- name: exec binary | |
run: ./sc --help | |
- name: update cobra docs | |
run: go run -tags=docgen main.go docs | |
- name: Commit and push changes | |
run: | | |
if [[ -n $(git status --porcelain) ]]; then | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "docs: Auto-update documentation" | |
git push origin main | |
else | |
echo "No changes detected. Nothing to commit." | |
fi |