Skip to content

Commit

Permalink
Set git config in CI yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
m417z committed Oct 9, 2024
1 parent 4690938 commit 85fc19f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install 'git+https://github.com/m417z/pymultitor.git' isal mitmproxy orjson requests signify
- name: Set up Git config
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Run periodic update
run: |
cd data
Expand Down
2 changes: 0 additions & 2 deletions data/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
index_of_hashes_title = 'Winbindex x64 Hashes'
index_of_hashes_out_path = out_path / '..' / 'hashes'

deploy_git_email = '[email protected]'
deploy_git_name = 'winbindex-deploy-bot'
deploy_save_disk_space = True
deploy_amend_last_commit = True

Expand Down
21 changes: 2 additions & 19 deletions data/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,6 @@ def run_deploy():
return f'Updated with files from {progress_state["update_kb"]}'


def can_deploy():
# Unsupported in this flow.
assert not config.extract_in_a_new_thread

# Can deploy only if there's no pending PR yet.
url = 'https://api.github.com/search/issues?q=is:pr+is:open+repo:m417z/winbindex+author:winbindex-deploy-bot'
return requests.get(url).json()['total_count'] == 0


def build_html_index_of_hashes():
def write_html(file, html_content, title='', full_version_link='..'):
title_full = config.index_of_hashes_title
Expand Down Expand Up @@ -467,11 +458,6 @@ def update_readme_stats():
f.write(readme)


def init_deploy():
subprocess.check_call(['git', 'config', '--global', 'user.email', config.deploy_git_email])
subprocess.check_call(['git', 'config', '--global', 'user.name', config.deploy_git_name])


def commit_deploy(pr_title):
# Make sure no accidental changes in the main repo.
# https://stackoverflow.com/a/25149786
Expand Down Expand Up @@ -524,11 +510,8 @@ def clean_deploy_files(pathspecs=[]):


def main():
if not can_deploy():
print('can_deploy() returned False, exiting')
return

init_deploy()
# Unsupported in this flow.
assert not config.extract_in_a_new_thread

while True:
pr_title = run_deploy()
Expand Down

0 comments on commit 85fc19f

Please sign in to comment.