Skip to content

Commit

Permalink
fix paths, and branch checkout order
Browse files Browse the repository at this point in the history
  • Loading branch information
xyzroe committed Jun 12, 2024
1 parent ac19639 commit 551535a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/update_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def write_features_file(features_file_path, updated_content):
print(f"Updated features file: {features_file_path}")

def main():
hw_file_path = 'src/const/hw.cpp'
features_file_path = 'docs/features.md'
hw_file_path = 'main_branch/src//const/hw.cpp'
features_file_path = 'mkdocs_branch/docs/features.md'

hw_content = read_hw_file(hw_file_path)
print(f"Read hw.cpp content: {len(hw_content)} characters")
Expand Down
29 changes: 13 additions & 16 deletions .github/workflows/update_devices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ jobs:
uses: actions/checkout@v2
with:
ref: main
path: main_branch

- name: Checkout mkdocs branch
uses: actions/checkout@v2
with:
ref: mkdocs
path: mkdocs_branch

- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -28,23 +35,13 @@ jobs:
python -m pip install --upgrade pip
- name: Run update_devices.py
run: python .github/scripts/update_devices.py

- name: Save updated features.md
run: |
mkdir -p updated_docs
cp docs/features.md updated_docs/features.md
- name: Checkout mkdocs branch
uses: actions/checkout@v2
with:
ref: mkdocs
run: python main_branch/.github/scripts/update_devices.py

- name: Copy updated features.md to mkdocs branch
- name: Commit and push changes
run: |
cp updated_docs/features.md docs/features.md
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
cd mkdocs_branch
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add docs/features.md
git commit -m 'Update features.md based on hw.cpp'
git commit -m 'Update features.md with new device data'
git push origin mkdocs

0 comments on commit 551535a

Please sign in to comment.