Skip to content

Commit

Permalink
ci(docs.yml): adding different tool for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
benjivesterby committed Mar 27, 2023
1 parent 5e0215b commit f0572a3
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ name: Update README with Go documentation

on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
pull-requests: write
contents: write
branches:
- main

jobs:
update-readme:
Expand All @@ -16,19 +12,23 @@ jobs:
- name: Check out repository
uses: actions/checkout@v3

- name: Fix Git repository permissions
run: git config --global --add safe.directory /home
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20

- name: Generate Go documentation and update README
run: |
go install github.com/robertkrimen/godocdown/godocdown
godocdown . > README.md
- name: Update readme according to Go doc
uses: posener/goreadme@v1
- name: Create or update pull request
uses: peter-evans/create-pull-request@v4
with:
email: "41898282+github-actions[bot]@users.noreply.github.com"
recursive: true
constants: true
variabless: true
functions: true
types: true
factories: true
credit: false
# Optional: Token allows goreadme to comment the PR with diff preview.
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs(README.md): update go documentation"
title: "Update Go documentation in README"
body: "This PR updates the Go documentation in the README."
branch: "update-go-documentation"
base: "main"
labels: "documentation,automerge"

0 comments on commit f0572a3

Please sign in to comment.