chore(ci): add a workflow to auto-commit docs changes #1
This file contains hidden or 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: Auto commit docs updates | |
| on: | |
| push: | |
| jobs: | |
| update_docs: | |
| name: Update CLI Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 1 | |
| - name: Set up Go | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Build CLI docs | |
| run: make docs | |
| - name: Commit and push docs changes | |
| run: | | |
| git config --global user.name 'equinix-labs@auto-commit-workflow' | |
| git config --global user.email 'bot@equinix.noreply.github.com' | |
| git config advice.addIgnoredFile false | |
| git add docs | |
| echo -e "\nGit status:" | |
| echo `git status` | |
| cdate=`date` | |
| cmsg="Auto commit generated docs changes - $cdate" | |
| echo -e "\nCommit message created : $cmsg" | |
| echo -e "\nCommitting if there are files to update in client dir:" | |
| echo `git commit -m "$cmsg"` | |
| echo `git push` |