Skip to content

add workflow py script #14

add workflow py script

add workflow py script #14

Workflow file for this run

name: Replace Text in README
on: [push]
jobs:
replace-text:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Replace text in README
run: |
python -c "
from mallm.utils.config import Config

Check failure on line 15 in .github/workflows/update_readme.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/update_readme.yml

Invalid workflow file

You have an error in your yaml syntax on line 15
import re
config = Config(data=None, out=None, instruction=None)
attributes = {attr: getattr(config, attr) for attr in dir(config) if not callable(getattr(config, attr)) and not attr.startswith('__')}
with open('README.md', 'r+') as readme_file:
content = readme_file.read()
attributes_content = ""
attributes = {attr: getattr(config, attr) for attr in dir(config) if not callable(getattr(config, attr)) and not attr.startswith('__')}
for attr, value in attributes.items():
attributes_content += f"{attr}: {value}\n"
replacement_str = "### Config Arguments:\n```py\n" + attributes_content + "```"
print(replacement_str)
updated_lines = re.sub(r"### Config Arguments:\n```py\n(.*?)```", replacement_str, content, flags=re.DOTALL)
readme_file.seek(0)
readme_file.writelines(updated_lines)
readme_file.truncate()
"
- name: Update README.md
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add README.md
git commit -am 'Update README'
git push