Skip to content
This repository was archived by the owner on Feb 22, 2025. It is now read-only.

Commit 3da0bcf

Browse files
committed
Sync GHA job
1 parent cbfd99e commit 3da0bcf

File tree

3 files changed

+46
-5
lines changed

3 files changed

+46
-5
lines changed

.github/workflows/sync.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Sync upstream docs
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Run daily at midnight UTC
6+
workflow_dispatch: # Allow manual triggering
7+
8+
jobs:
9+
sync-docs:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Get upstream SHA
17+
id: sha
18+
run: |
19+
SHA=$(curl -s "https://api.github.com/repos/bpftrace/bpftrace/commits?path=man/adoc/bpftrace.adoc&per_page=1" | jq -r '.[0].sha')
20+
echo "sha=$SHA" >> $GITHUB_OUTPUT
21+
22+
- name: Download upstream doc
23+
run: curl -o src/docs/master.adoc https://raw.githubusercontent.com/bpftrace/bpftrace/master/man/adoc/bpftrace.adoc
24+
25+
- name: Check for source changes
26+
id: diff
27+
run: |
28+
git diff --exit-code src/docs/master.adoc || echo "changed=true" >> $GITHUB_OUTPUT
29+
30+
- name: Build HTML
31+
if: steps.diff.outputs.changed == 'true'
32+
run: make docs/master.html
33+
34+
- name: Create Pull Request
35+
if: steps.diff.outputs.changed == 'true'
36+
uses: peter-evans/create-pull-request@v5
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
commit-message: "docs: Sync with upstream"
40+
title: "docs: Sync with upstream"
41+
branch: docs/sync-upstream
42+
delete-branch: true
43+
body: |
44+
Automated PR to sync bpftrace documentation with upstream.
45+
46+
Source: https://github.com/bpftrace/bpftrace/blob/${{ steps.sha.outputs.sha }}/man/adoc/bpftrace.adoc

.nojekyll

Whitespace-only changes.

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,3 @@ in un-edited files directly from bpftrace repository.
1313
When adding a documentation for a new release, you'll also want to update
1414
`src/header.html` with a new drop-down selection. You'll also want to update
1515
`index.md` to point to the latest release.
16-
17-
### Notes
18-
19-
* Followed https://gist.github.com/matt-bailey/bbbc181d5234c618e4dfe0642ad80297
20-
to set up DNS records

0 commit comments

Comments
 (0)