Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
dubloom committed Sep 30, 2024
1 parent 7b8db3d commit 07f0767
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
python--version: '3.x'
- name: Check and Modify
run: echo "NGINX_VERSION_TO_TEST=$(python bin/nginx_dependencies.py)" >> $GITHUB_ENV
- name: Test
run: echo $NGINX_VERSION_TO_TEST
- name: Create Pull Request
id: pr
uses: peter-evans/[email protected]
Expand Down
22 changes: 10 additions & 12 deletions bin/nginx_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def if_version_supported(version):
return tuple(map(int, version.split('.'))) > tuple(map(int, LATEST_VERSION_SUPPORTED.split('.')))

def update_nginx_version(source_file, destination_file, new_version):
with open(source_file, 'r') as file:
with open(source_file) as file:
file_content = file.read()

updated_content = file_content.replace("{NGINX_VERSION}", new_version)
Expand All @@ -25,14 +25,12 @@ def update_nginx_version(source_file, destination_file, new_version):

if get_nginx_release_versions.returncode != 0:
print("Could not get nginx versions:", stderr.decode())
exit()


for line in stdout.decode().splitlines():
version, link = line.split(' ', 1)

if if_version_supported(version):
print("export NGINX_VERSION_TO_TEST="+version)
update_nginx_version("base_config.yml", "config.yml", version)
subprocess.run(["mv config.yml ../.circleci/config.yml"], shell=True, check=True)
break
else:
for line in stdout.decode().splitlines():
version, link = line.split(' ', 1)

if if_version_supported(version):
print("export NGINX_VERSION_TO_TEST="+version)
update_nginx_version("base_config.yml", "config.yml", version)
subprocess.run(["mv config.yml ../.circleci/config.yml"], shell=True, check=True)
break

0 comments on commit 07f0767

Please sign in to comment.