Skip to content

Generate Go Integrations Documentation #1234

Generate Go Integrations Documentation

Generate Go Integrations Documentation #1234

---
# CI workflow used to generate documentation from integrations/integrations.js.
name: Generate Go Integrations Documentation
on:
workflow_dispatch: null
schedule:
- cron: "0 8-23/3 * * *" # every 3rd hour from 8 through 23
concurrency: # This keeps multiple instances of the job from running concurrently for the same ref.
group: generate-go-integrations-docs-${{ github.ref }}
cancel-in-progress: true
jobs:
generate-go-integrations-documentation:
name: Generate Go Integrations Documentation
runs-on: ubuntu-latest
if: github.repository == 'netdata/go.d.plugin'
steps:
- name: Get the latest go release tag
id: go-tag
run: |
tag="$(curl "https://github.com/netdata/go.d.plugin/releases/latest" -s -L -I -o /dev/null -w '%{url_effective}' | grep -m 1 -o '[^/]*$')"
echo "latest tag is ${tag}"
echo "releasetag=${tag}" >> $GITHUB_ENV
- name: Checkout Go repo
id: checkout-go
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
ref: ${{ steps.go-tag.outputs.releasetag }}
- name: Get integrations.js
run: |
curl https://raw.githubusercontent.com/netdata/netdata/master/integrations/integrations.js --create-dirs -o ./integrations/integrations.js
- name: Get gen_docs_integrations.py
run: |
curl https://raw.githubusercontent.com/netdata/netdata/master/integrations/gen_docs_integrations.py --create-dirs -o ./integrations/gen_docs_integrations.py
- name: Generate Go Integrations Documentation
id: generate
run: |
python3 integrations/gen_docs_integrations.py
- name: Remove integrations dir
run: |
rm -rf integrations/
- name: Create PR
id: create-pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Generate Integrations Documentation
branch: integrations-docs
title: Integrations Documentation
base: ${{ github.head_ref }}
body: |
Generate Documentation from `integrations/integrations.js` based on the latest code.
This PR was auto-generated by
`.github/workflows/generate-integrations-docs.yml`.