-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enforce up-to-date docs via GitHub Actions
- Loading branch information
anttiharju
committed
Sep 1, 2024
1 parent
03f0c61
commit 032487d
Showing
4 changed files
with
45 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
if ! git diff --quiet --staged; then | ||
echo "You have staged changes; cannot ensure docs are up-to-date." | ||
exit 1 | ||
fi | ||
|
||
./scripts/g.sh | ||
|
||
if git diff --quiet -- bin/g; then | ||
exit 0 | ||
fi | ||
|
||
git add bin/g | ||
name="github-actions[bot]" | ||
email="41898282+github-actions[bot]@users.noreply.github.com" | ||
GIT_COMMITTER_NAME="$name" GIT_COMMITTER_EMAIL="$email" git commit --no-verify -m \ | ||
"Update bin/g docs | ||
./scripts/update-g-docs.sh " | ||
via .githooks/pre-push" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Update docs | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- 'bin/g*' | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
g: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
scripts/update-g-docs.sh | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
if ! git diff --quiet --staged; then | ||
echo "You have staged changes; cannot ensure docs are up-to-date." | ||
exit 1 | ||
fi | ||
|
||
./scripts/g.sh | ||
|
||
if git diff --quiet -- bin/g; then | ||
exit 0 | ||
fi | ||
|
||
# Set source to empty string if $1 is unbound. | ||
source="${1:-}" | ||
|
||
git add bin/g | ||
name="github-actions[bot]" | ||
email="41898282+github-actions[bot]@users.noreply.github.com" | ||
GIT_COMMITTER_NAME="$name" GIT_COMMITTER_EMAIL="$email" git commit --no-verify -m \ | ||
"Update bin/g docs$source" |