Sync upstream docs #60
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
name: Sync upstream docs | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Run daily at midnight UTC | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
sync-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get upstream SHA | |
id: sha | |
run: | | |
SHA=$(curl -s "https://api.github.com/repos/bpftrace/bpftrace/commits?path=man/adoc/bpftrace.adoc&per_page=1" | jq -r '.[0].sha') | |
echo "sha=$SHA" >> $GITHUB_OUTPUT | |
- name: Download upstream doc | |
run: curl -o src/docs/master.adoc https://raw.githubusercontent.com/bpftrace/bpftrace/master/man/adoc/bpftrace.adoc | |
- name: Check for source changes | |
id: diff | |
run: | | |
git diff --exit-code src/docs/master.adoc || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Build HTML | |
if: steps.diff.outputs.changed == 'true' | |
run: make docs/master.html | |
- name: Create Pull Request | |
if: steps.diff.outputs.changed == 'true' | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "docs: Sync with upstream" | |
title: "docs: Sync with upstream" | |
branch: docs/sync-upstream | |
delete-branch: true | |
body: | | |
Automated PR to sync bpftrace documentation with upstream. | |
Source: https://github.com/bpftrace/bpftrace/blob/${{ steps.sha.outputs.sha }}/man/adoc/bpftrace.adoc |