-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (26 loc) · 1005 Bytes
/
hype.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Generate README with Hype
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22.x"
cache-dependency-path: subdir/go.sum
- name: Install hype
run: go install github.com/gopherguides/hype/cmd/hype@latest
- name: Run hype
run: pushd .hype;hype export -format=markdown -f module.md > ../README.md;popd
- name: Commit README back to the repo
run: |-
git rev-parse --abbrev-ref HEAD
git config user.name 'GitHub Actions'
git config user.email '[email protected]'
git diff --quiet || (git add README.md && git commit -am "Updated README")
git push origin ${{github.event.pull_request.head.ref}}