Skip to content

Commit

Permalink
Merge pull request #12 from go-slog/auto-generate-readme
Browse files Browse the repository at this point in the history
Auto generate readme
  • Loading branch information
sagikazarmark authored Dec 18, 2023
2 parents 53cfaa8 + 8ef0b29 commit ac0269e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
- name: Regenerate README
run: nix develop --impure .#ci -c make generate

- name: Check diff
run: git diff --quiet README.md || (echo "Please run 'make generate' to regenerate README.md" && exit 1)
# - name: Check diff
# run: git diff --quiet README.md || (echo "Please run 'make generate' to regenerate README.md" && exit 1)

dev:
name: Developer environment
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Generate

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
readme:
name: README.md
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Nix
uses: cachix/install-nix-action@7ac1ec25491415c381d9b62f0657c7a028df52a7 # v24
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Set up magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@8a218f9e264e9c3803c9a1ee1c30d8e4ab55be63 # v2

- name: Prepare Nix shell
run: nix develop --impure .#ci

- name: Regenerate README
run: nix develop --impure .#ci -c make generate

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Regenerate README.md
file_pattern: README.md
if: github.event_name == 'push'
6 changes: 5 additions & 1 deletion data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ categories:
- name: slog-parquet
link: https://github.com/samber/slog-parquet
description: Handler forwarding logs to an object store in parquet format.

- name: slog-pushover
link: https://github.com/SkYNewZ/slog-pushover
description: Handler forwarding logs to Pushover.
Expand Down Expand Up @@ -166,6 +166,10 @@ categories:
link: https://github.com/FabienMht/ginslog
description: A fully featured Gin middleware.

- name: slog-chi
link: https://github.com/samber/slog-chi
description: Chi middleware.

- name: slog-echo
link: https://github.com/samber/slog-echo
description: Echo middleware.
Expand Down

0 comments on commit ac0269e

Please sign in to comment.