Skip to content

Commit 598e82c

Browse files
committed
removed pre-commit and made it a workglof
1 parent 15b89d7 commit 598e82c

File tree

2 files changed

+46
-9
lines changed

2 files changed

+46
-9
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Workflow to run plugin documentation generation then commit the updated changes
2+
3+
name: Plugin Documentation Generator
4+
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: '0 0 * * *'
9+
10+
jobs:
11+
generate_docs:
12+
13+
runs-on: 'Docker-in-Docker'
14+
container: python:3.10
15+
env:
16+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
17+
BRANCH_NAME: ${{ github.ref_name }}
18+
steps:
19+
- name: Code checkout
20+
run: |
21+
rm -rf node-scraper
22+
git clone -b ${BRANCH_NAME} https://${GITHUB_PAT}@github.com/amd/node-scraper.git node-scraper
23+
24+
- name: Install dependencies
25+
run: |
26+
cd node-scraper
27+
./dev-setup.sh
28+
29+
- name: Run plugin documentation generator
30+
run: |
31+
cd node-scraper/docs
32+
python generate_plugin_doc_bundle.py --package nodescraper.plugins.inband --output PLUGIN_DOC.md
33+
34+
- name: Commit documentation changes
35+
run: |
36+
git config --global user.name "github-actions[bot]"
37+
git config --global user.email "<>"
38+
cd node-scraper
39+
git add docs/PLUGIN_DOC.md
40+
git commit -m "Updated plugin documentation" || echo "No changes to plugin documentation"
41+
git push
42+
43+
- name: Clean up
44+
if: always()
45+
run: |
46+
rm -rf node-scraper

.pre-commit-config.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,3 @@ repos:
2121
- id: mypy
2222
args: [--install-types, --non-interactive, --explicit-package-bases, --allow-redefinition]
2323
language: system
24-
- repo: local
25-
hooks:
26-
- id: generate-plugin-docs
27-
name: Generate Plugin Documentation
28-
entry: bash -c 'python docs/generate_plugin_doc_bundle.py --package nodescraper.plugins.inband --output docs/PLUGIN_DOC.md && git add docs/PLUGIN_DOC.md'
29-
language: system
30-
files: ^nodescraper/plugins/inband/.*\.py$
31-
pass_filenames: false
32-
always_run: false

0 commit comments

Comments
 (0)