` Handy little GitHub action for auto-updating documentation » Motion design agency graphics studios

Handy little GitHub action for auto-updating documentation

I spent some time yesterday trying to get a GitHub action that will automatically update my documentation. I thought my final solution was kinda nifty and was wondering if you guys have solved this problem in other ways.

name: Generate Docs on: push: branches: [ master ] jobs: docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Go uses: actions/setup-go@v2 with: go-version: 1.15 - name: GenDocs id: GenDocs continue-on-error: true run: | GO111MODULE=on go get -u github.com/princjef/gomarkdoc/cmd/gomarkdoc ~/go/bin/gomarkdoc . > ./docs.md exit $(git diff docs.md | wc -c) - name: Commit Changes if: steps.GenDocs.outcome == 'failure' run: | git config --global user.name 'AutoDocAction' git config --global user.email 'AudoDocAction@no-reply.com' git add docs.md git commit -m "auto generated docs" git push 

Although as I typed this up I realized I'm an idiot and I could have just allowed the Commit Changes step to continue-on-error.

submitted by /u/33KGB
[link] [comments]
---
[fixed][/fixed]
jodo