Skip to content

Commit

Permalink
Update hype.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Feb 14, 2024
1 parent 51abae6 commit ede21cb
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/hype.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
name: Generate README with Hype
on: [pull_request]
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
- 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: 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: 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}}
- 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}}

0 comments on commit ede21cb

Please sign in to comment.