From 438cff319b352712b6e75e6ae6c84beb4ad19907 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 12 Jun 2022 03:15:08 +0000 Subject: [PATCH 01/67] =?UTF-8?q?Bump=20version:=201.0.0=20=E2=86=92=201.0?= =?UTF-8?q?.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 860be11..741cf0e 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.0 +current_version = 1.0.1 commit = True tag = False diff --git a/setup.py b/setup.py index d5a2463..2df1eab 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( name="github-deploy", - version="1.0.0", + version="1.0.1", description="Deploy yaml files to a large number of repositories in seconds.", long_description=LONG_DESCRIPTION, long_description_content_type=LONG_DESCRIPTION_TYPE, From cad47bc792e87066b72eba8ec7cce786982b31c0 Mon Sep 17 00:00:00 2001 From: jackton1 Date: Sun, 12 Jun 2022 03:15:21 +0000 Subject: [PATCH 02/67] =?UTF-8?q?Upgraded=20from=20v1.0.0=20=E2=86=92=20v1?= =?UTF-8?q?.0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b51c49..27a9493 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [v1.0.1](https://github.com/tj-python/github-deploy/tree/v1.0.1) (2022-06-12) + +[Full Changelog](https://github.com/tj-python/github-deploy/compare/v1.0.0...v1.0.1) + +**Merged pull requests:** + +- Bump actions/setup-python from 2 to 4 [\#14](https://github.com/tj-python/github-deploy/pull/14) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump peter-evans/create-pull-request from 3 to 4 [\#13](https://github.com/tj-python/github-deploy/pull/13) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump tj-actions/semver-diff from 1.2.0 to 2.0.0 [\#12](https://github.com/tj-python/github-deploy/pull/12) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump tj-actions/github-changelog-generator from 1.8 to 1.13 [\#11](https://github.com/tj-python/github-deploy/pull/11) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump actions/checkout from 2 to 3 [\#10](https://github.com/tj-python/github-deploy/pull/10) ([dependabot[bot]](https://github.com/apps/dependabot)) +- feat: Improve error handling [\#9](https://github.com/tj-python/github-deploy/pull/9) ([jackton1](https://github.com/jackton1)) +- Upgraded 0.0.9 → v1.0.0 [\#8](https://github.com/tj-python/github-deploy/pull/8) ([jackton1](https://github.com/jackton1)) + ## [v1.0.0](https://github.com/tj-python/github-deploy/tree/v1.0.0) (2022-02-12) [Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.9...v1.0.0) @@ -22,15 +36,15 @@ ## [0.0.7](https://github.com/tj-python/github-deploy/tree/0.0.7) (2021-11-15) -[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.5...0.0.7) +[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.6...0.0.7) -## [0.0.5](https://github.com/tj-python/github-deploy/tree/0.0.5) (2021-11-15) +## [0.0.6](https://github.com/tj-python/github-deploy/tree/0.0.6) (2021-11-15) -[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.6...0.0.5) +[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.5...0.0.6) -## [0.0.6](https://github.com/tj-python/github-deploy/tree/0.0.6) (2021-11-15) +## [0.0.5](https://github.com/tj-python/github-deploy/tree/0.0.5) (2021-11-15) -[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.4...0.0.6) +[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.4...0.0.5) **Merged pull requests:** From 6fc419417ef5853c6cf858189182117a6aad8310 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 11 Jun 2022 23:20:03 -0400 Subject: [PATCH 03/67] Update main.py --- github_deploy/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github_deploy/main.py b/github_deploy/main.py index 2acef84..8322d65 100644 --- a/github_deploy/main.py +++ b/github_deploy/main.py @@ -24,7 +24,7 @@ def get_command(self, ctx, name): eval(code, ns, ns) return ns['main'] - ctx.fail("Invalid Command: {name}".format(name=name)) + ctx.fail("Invalid Command \"{name}\"".format(name=name)) main = GithubDeploy( From 42a857e0413d95389b566d188d99ce531c11e7dd Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 11 Jun 2022 23:20:59 -0400 Subject: [PATCH 04/67] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index b099986..2f9fd94 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ This can introduce a number challenges one of which is maintaining consistency a > For example adding a github action or maintaing a consistent pull request template accross your organization. - ## Solution `github-deploy` makes maintaining such configurations as easy as a single command. From 24b554d3698c114e7ecb00612a45426257839979 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 11 Jun 2022 23:23:58 -0400 Subject: [PATCH 05/67] Create codacy.yml --- .github/workflows/codacy.yml | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/codacy.yml diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml new file mode 100644 index 0000000..8be0fdb --- /dev/null +++ b/.github/workflows/codacy.yml @@ -0,0 +1,60 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow checks out code, performs a Codacy security scan +# and integrates the results with the +# GitHub Advanced Security code scanning feature. For more information on +# the Codacy security scan action usage and parameters, see +# https://github.com/codacy/codacy-analysis-cli-action. +# For more information on Codacy Analysis CLI in general, see +# https://github.com/codacy/codacy-analysis-cli. + +name: Codacy Security Scan + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '39 21 * * 4' + +permissions: + contents: read + +jobs: + codacy-security-scan: + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + name: Codacy Security Scan + runs-on: ubuntu-latest + steps: + # Checkout the repository to the GitHub Actions runner + - name: Checkout code + uses: actions/checkout@v3 + + # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis + - name: Run Codacy Analysis CLI + uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b + with: + # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository + # You can also omit the token and run the tools that support default configurations + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + verbose: true + output: results.sarif + format: sarif + # Adjust severity of non-security issues + gh-code-scanning-compat: true + # Force 0 exit code to allow SARIF file generation + # This will handover control about PR rejection to the GitHub side + max-allowed-issues: 2147483647 + + # Upload the SARIF file generated in the previous step + - name: Upload SARIF results file + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: results.sarif From 2b27932ef2e035d58714764c34334e64bfb33ac0 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 11 Jun 2022 23:33:14 -0400 Subject: [PATCH 06/67] Fixed lint errors. --- github_deploy/__init__.py | 2 +- github_deploy/commands/__init__.py | 2 +- github_deploy/commands/_utils.py | 2 +- github_deploy/commands/delete.py | 16 +++++++++------- github_deploy/commands/upload.py | 19 +++++++++++-------- github_deploy/main.py | 19 +++++++++++-------- setup.py | 2 +- 7 files changed, 35 insertions(+), 27 deletions(-) diff --git a/github_deploy/__init__.py b/github_deploy/__init__.py index 0260537..8db66d3 100644 --- a/github_deploy/__init__.py +++ b/github_deploy/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/github_deploy/commands/__init__.py b/github_deploy/commands/__init__.py index 0260537..8db66d3 100644 --- a/github_deploy/commands/__init__.py +++ b/github_deploy/commands/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/github_deploy/commands/_utils.py b/github_deploy/commands/_utils.py index 67cdb6b..ad0bb0d 100644 --- a/github_deploy/commands/_utils.py +++ b/github_deploy/commands/_utils.py @@ -3,4 +3,4 @@ def get_repo(*, org, project): def can_upload(*, repo, include_private): - return True if include_private and repo['private'] == True else not repo['private'] + return True if include_private and repo["private"] == True else not repo["private"] diff --git a/github_deploy/commands/delete.py b/github_deploy/commands/delete.py index f85c9c0..499cda0 100644 --- a/github_deploy/commands/delete.py +++ b/github_deploy/commands/delete.py @@ -80,9 +80,7 @@ async def check_exists(*, session, repo, dest, token, semaphore, skip_missing): return response -async def handle_file_delete( - *, repo, dest, token, semaphore, session -): +async def handle_file_delete(*, repo, dest, token, semaphore, session): check_exists_response = await check_exists( session=session, repo=repo, @@ -114,7 +112,7 @@ async def handle_file_delete( exists=exists, current_sha=current_sha, ) - + if delete_response: return click.style( "Successfully deleted contents at {repo}/{dest}".format( @@ -124,7 +122,7 @@ async def handle_file_delete( fg="green", bold=True, ) - + return click.style( "No content found at {repo}/{dest}".format(repo=repo, dest=dest), fg="blue", @@ -154,7 +152,7 @@ async def list_repos(*, session, org, token): prompt=click.style("Enter your personal access token", bold=True), help="Personal Access token with read and write access to org.", hide_input=True, - envvar='TOKEN', + envvar="TOKEN", ) @click.option( "--dest", @@ -182,7 +180,11 @@ async def main(org, token, dest): fg="green", ) ) - click.echo(click.style('Deleting "{path}" for all repositories:'.format(path=dest), fg="blue")) + click.echo( + click.style( + 'Deleting "{path}" for all repositories:'.format(path=dest), fg="blue" + ) + ) click.echo("\n".join(repos)) c = click.prompt(click.style("Continue? [YN] ", fg="blue")) diff --git a/github_deploy/commands/upload.py b/github_deploy/commands/upload.py index 47d453c..4c24d77 100644 --- a/github_deploy/commands/upload.py +++ b/github_deploy/commands/upload.py @@ -120,7 +120,7 @@ async def handle_file_upload( path=dest, ), fg="blue", - bold=True + bold=True, ) else: @@ -154,7 +154,7 @@ async def handle_file_upload( dest=upload_response["content"]["path"], ), fg="green", - bold=True + bold=True, ) @@ -180,7 +180,7 @@ async def list_repos(*, session, org, token): prompt=click.style("Enter your personal access token", bold=True), help="Personal Access token with read and write access to org.", hide_input=True, - envvar='TOKEN', + envvar="TOKEN", ) @click.option( "--source", @@ -219,10 +219,12 @@ async def main(org, token, source, dest, overwrite, private): for r in response["items"] if not r["archived"] and can_upload(repo=r, include_private=private) ] - repo_type = 'public and private' if private else 'public' + repo_type = "public and private" if private else "public" click.echo( click.style( - "Found '{}' repositories non archived {} repositories:".format(len(repos), repo_type), + "Found '{}' repositories non archived {} repositories:".format( + len(repos), repo_type + ), fg="green", ) ) @@ -238,11 +240,12 @@ async def main(org, token, source, dest, overwrite, private): ) ) deploy_msg = ( - 'Deploying "{source}" to "{path}" for all repositories'.format(source=source, path=dest) + 'Deploying "{source}" to "{path}" for all repositories'.format( + source=source, path=dest + ) if overwrite else 'Deploying "{source}" to repositories that don\'t already have contents at "{path}"'.format( - source=source, - path=dest + source=source, path=dest ) ) click.echo(click.style(deploy_msg, fg="blue")) diff --git a/github_deploy/main.py b/github_deploy/main.py index 2acef84..351fc7f 100644 --- a/github_deploy/main.py +++ b/github_deploy/main.py @@ -1,35 +1,38 @@ import asyncclick as click import os -plugin_folder = os.path.join(os.path.dirname(__file__), 'commands') +plugin_folder = os.path.join(os.path.dirname(__file__), "commands") class GithubDeploy(click.MultiCommand): - def list_commands(self, ctx): rv = [] for filename in os.listdir(plugin_folder): - if filename.endswith('.py') and not filename.startswith('__init__') and not filename.startswith('_'): + if ( + filename.endswith(".py") + and not filename.startswith("__init__") + and not filename.startswith("_") + ): rv.append(filename[:-3]) rv.sort() return rv def get_command(self, ctx, name): ns = {} - fn = os.path.join(plugin_folder, name + '.py') + fn = os.path.join(plugin_folder, name + ".py") if os.path.exists(fn): with open(fn) as f: - code = compile(f.read(), fn, 'exec') + code = compile(f.read(), fn, "exec") eval(code, ns, ns) - return ns['main'] + return ns["main"] ctx.fail("Invalid Command: {name}".format(name=name)) main = GithubDeploy( - help='Deploy changes to multiple github repositories using a single command.', + help="Deploy changes to multiple github repositories using a single command.", ) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/setup.py b/setup.py index d5a2463..841b4fa 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ author_email="jtonye@ymail.com", license="MIT", packages=find_packages(), - python_requires='>=3.6', + python_requires=">=3.6", extras_require=extras_require, install_requires=[ "asyncclick", From 44414324c163bb793700e59af00698b5cb5f97fd Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 11 Jun 2022 23:34:57 -0400 Subject: [PATCH 07/67] Fixed lint errors. --- github_deploy/commands/_utils.py | 6 +++++- github_deploy/commands/delete.py | 16 ++++++++++++---- github_deploy/commands/upload.py | 20 +++++++++++++++----- setup.py | 8 +++++++- 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/github_deploy/commands/_utils.py b/github_deploy/commands/_utils.py index ad0bb0d..cc4ea9c 100644 --- a/github_deploy/commands/_utils.py +++ b/github_deploy/commands/_utils.py @@ -3,4 +3,8 @@ def get_repo(*, org, project): def can_upload(*, repo, include_private): - return True if include_private and repo["private"] == True else not repo["private"] + return ( + True + if include_private and repo["private"] == True + else not repo["private"] + ) diff --git a/github_deploy/commands/delete.py b/github_deploy/commands/delete.py index 499cda0..e045109 100644 --- a/github_deploy/commands/delete.py +++ b/github_deploy/commands/delete.py @@ -63,7 +63,9 @@ async def delete_content( url = BASE_URL.format(repo=repo, path=dest) async with semaphore: - response = await delete(session=session, url=url, data=data, headers=headers) + response = await delete( + session=session, url=url, data=data, headers=headers + ) return response @@ -74,7 +76,10 @@ async def check_exists(*, session, repo, dest, token, semaphore, skip_missing): async with semaphore: response = await get( - session=session, url=url, headers=headers, skip_missing=skip_missing + session=session, + url=url, + headers=headers, + skip_missing=skip_missing, ) return response @@ -176,13 +181,16 @@ async def main(org, token, dest): ] click.echo( click.style( - "Found '{}' repositories non archived repositories".format(len(repos)), + "Found '{}' repositories non archived repositories".format( + len(repos) + ), fg="green", ) ) click.echo( click.style( - 'Deleting "{path}" for all repositories:'.format(path=dest), fg="blue" + 'Deleting "{path}" for all repositories:'.format(path=dest), + fg="blue", ) ) click.echo("\n".join(repos)) diff --git a/github_deploy/commands/upload.py b/github_deploy/commands/upload.py index 4c24d77..68d6336 100644 --- a/github_deploy/commands/upload.py +++ b/github_deploy/commands/upload.py @@ -70,7 +70,9 @@ async def upload_content( return data = { - "message": "Updated {}".format(dest) if exists else "Added {}".format(dest), + "message": "Updated {}".format(dest) + if exists + else "Added {}".format(dest), "content": base64_content, } if exists: @@ -79,7 +81,9 @@ async def upload_content( url = BASE_URL.format(repo=repo, path=dest) async with semaphore: - response = await put(session=session, url=url, data=data, headers=headers) + response = await put( + session=session, url=url, data=data, headers=headers + ) return response @@ -90,7 +94,10 @@ async def check_exists(*, session, repo, dest, token, semaphore, skip_missing): async with semaphore: response = await get( - session=session, url=url, headers=headers, skip_missing=skip_missing + session=session, + url=url, + headers=headers, + skip_missing=skip_missing, ) return response @@ -195,7 +202,9 @@ async def list_repos(*, session, org, token): ) @click.option( "--overwrite/--no-overwrite", - prompt=click.style("Should we overwrite existing contents at this path", fg="blue"), + prompt=click.style( + "Should we overwrite existing contents at this path", fg="blue" + ), help="Overwrite existing files.", default=False, ) @@ -217,7 +226,8 @@ async def main(org, token, source, dest, overwrite, private): repos = [ get_repo(org=org, project=r["name"]) for r in response["items"] - if not r["archived"] and can_upload(repo=r, include_private=private) + if not r["archived"] + and can_upload(repo=r, include_private=private) ] repo_type = "public and private" if private else "public" click.echo( diff --git a/setup.py b/setup.py index 841b4fa..5c1a858 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,13 @@ "gh-deploy=github_deploy.main:main", ], }, - keywords=["yaml", "deploy", "poly repository", "github", "single configuration"], + keywords=[ + "yaml", + "deploy", + "poly repository", + "github", + "single configuration", + ], author="Tonye Jack", author_email="jtonye@ymail.com", license="MIT", From 554dcf877d74a0b64111a296aa726c7d7dd154e5 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 11 Jun 2022 23:46:49 -0400 Subject: [PATCH 08/67] Refactor application --- github_deploy/commands/_http_utils.py | 64 +++++++++++++++++++++++++++ github_deploy/commands/_utils.py | 2 +- github_deploy/commands/delete.py | 48 +------------------- github_deploy/commands/upload.py | 48 +------------------- 4 files changed, 69 insertions(+), 93 deletions(-) create mode 100644 github_deploy/commands/_http_utils.py diff --git a/github_deploy/commands/_http_utils.py b/github_deploy/commands/_http_utils.py new file mode 100644 index 0000000..d736fe7 --- /dev/null +++ b/github_deploy/commands/_http_utils.py @@ -0,0 +1,64 @@ +import ssl +import certifi + +import asyncclick as click + +from github_deploy.commands._constants import REPOS_URL + + +async def get(*, session, url, headers=None, skip_missing=False): + ssl_context = ssl.create_default_context(cafile=certifi.where()) + + async with session.get( + url, + headers=headers, + timeout=70, + ssl_context=ssl_context, + raise_for_status=not skip_missing, + ) as response: + if skip_missing and response.status == 404: + return {} + + value = await response.json() + return value + + +async def put(*, session, url, data, headers=None): + ssl_context = ssl.create_default_context(cafile=certifi.where()) + + async with session.put( + url, + json=data, + headers=headers, + timeout=70, + ssl_context=ssl_context, + raise_for_status=True, + ) as response: + value = await response.json() + return value + + +async def delete(*, session, url, data, headers=None): + ssl_context = ssl.create_default_context(cafile=certifi.where()) + + async with session.delete( + url, + json=data, + headers=headers, + timeout=70, + ssl_context=ssl_context, + raise_for_status=True, + ) as response: + value = await response.json() + return value + + +async def list_repos(*, session, org, token): + headers = { + "Authorization": "token {token}".format(token=token), + "Accept": "application/vnd.github.v3+json", + } + url = REPOS_URL.format(org=org) + click.echo("Retrieving repos at {}".format(url)) + response = await get(session=session, url=url, headers=headers) + return response diff --git a/github_deploy/commands/_utils.py b/github_deploy/commands/_utils.py index cc4ea9c..109bd3f 100644 --- a/github_deploy/commands/_utils.py +++ b/github_deploy/commands/_utils.py @@ -5,6 +5,6 @@ def get_repo(*, org, project): def can_upload(*, repo, include_private): return ( True - if include_private and repo["private"] == True + if include_private and repo["private"] is True else not repo["private"] ) diff --git a/github_deploy/commands/delete.py b/github_deploy/commands/delete.py index e045109..8ead88e 100644 --- a/github_deploy/commands/delete.py +++ b/github_deploy/commands/delete.py @@ -1,46 +1,13 @@ import asyncio -import ssl import aiohttp import asyncclick as click -import certifi -from github_deploy.commands._constants import BASE_URL, REPOS_URL +from github_deploy.commands._constants import BASE_URL +from github_deploy.commands._http_utils import delete, get, list_repos from github_deploy.commands._utils import get_repo -async def get(*, session, url, headers=None, skip_missing=False): - ssl_context = ssl.create_default_context(cafile=certifi.where()) - - async with session.get( - url, - headers=headers, - timeout=70, - ssl_context=ssl_context, - raise_for_status=not skip_missing, - ) as response: - if skip_missing and response.status == 404: - return {} - - value = await response.json() - return value - - -async def delete(*, session, url, data, headers=None): - ssl_context = ssl.create_default_context(cafile=certifi.where()) - - async with session.delete( - url, - json=data, - headers=headers, - timeout=70, - ssl_context=ssl_context, - raise_for_status=True, - ) as response: - value = await response.json() - return value - - async def delete_content( *, session, @@ -135,17 +102,6 @@ async def handle_file_delete(*, repo, dest, token, semaphore, session): ) -async def list_repos(*, session, org, token): - headers = { - "Authorization": "token {token}".format(token=token), - "Accept": "application/vnd.github.v3+json", - } - url = REPOS_URL.format(org=org) - click.echo("Retrieving repos at {}".format(url)) - response = await get(session=session, url=url, headers=headers) - return response - - @click.command() @click.option( "--org", diff --git a/github_deploy/commands/upload.py b/github_deploy/commands/upload.py index 68d6336..fe58e6d 100644 --- a/github_deploy/commands/upload.py +++ b/github_deploy/commands/upload.py @@ -1,48 +1,15 @@ import asyncio import base64 -import ssl import aiofiles import aiohttp import asyncclick as click -import certifi -from github_deploy.commands._constants import BASE_URL, REPOS_URL +from github_deploy.commands._constants import BASE_URL +from github_deploy.commands._http_utils import put, list_repos, get from github_deploy.commands._utils import get_repo, can_upload -async def get(*, session, url, headers=None, skip_missing=False): - ssl_context = ssl.create_default_context(cafile=certifi.where()) - - async with session.get( - url, - headers=headers, - timeout=70, - ssl_context=ssl_context, - raise_for_status=not skip_missing, - ) as response: - if skip_missing and response.status == 404: - return {} - - value = await response.json() - return value - - -async def put(*, session, url, data, headers=None): - ssl_context = ssl.create_default_context(cafile=certifi.where()) - - async with session.put( - url, - json=data, - headers=headers, - timeout=70, - ssl_context=ssl_context, - raise_for_status=True, - ) as response: - value = await response.json() - return value - - async def upload_content( *, session, @@ -165,17 +132,6 @@ async def handle_file_upload( ) -async def list_repos(*, session, org, token): - headers = { - "Authorization": "token {token}".format(token=token), - "Accept": "application/vnd.github.v3+json", - } - url = REPOS_URL.format(org=org) - click.echo("Retrieving repos at {}".format(url)) - response = await get(session=session, url=url, headers=headers) - return response - - @click.command() @click.option( "--org", From 989b6bdc749342f2e2bbe8daf195b5f5340bff2e Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 11 Jun 2022 23:48:15 -0400 Subject: [PATCH 09/67] Fixed lint errors. --- github_deploy/main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/github_deploy/main.py b/github_deploy/main.py index 7508a4e..d93075b 100644 --- a/github_deploy/main.py +++ b/github_deploy/main.py @@ -9,9 +9,9 @@ def list_commands(self, ctx): rv = [] for filename in os.listdir(plugin_folder): if ( - filename.endswith(".py") - and not filename.startswith("__init__") - and not filename.startswith("_") + filename.endswith(".py") + and not filename.startswith("__init__") + and not filename.startswith("_") ): rv.append(filename[:-3]) rv.sort() @@ -31,7 +31,9 @@ def get_command(self, ctx, name): main = GithubDeploy( - help="Deploy changes to multiple github repositories using a single command.", + help=( + "Deploy changes to multiple github repositories using a single command." + ), ) if __name__ == "__main__": From 4eeb7f0ead2e372ba57a66b5d602c8822eb4fa87 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 11 Jun 2022 23:49:48 -0400 Subject: [PATCH 10/67] Fixed lint errors. --- github_deploy/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/github_deploy/main.py b/github_deploy/main.py index d93075b..c7cce59 100644 --- a/github_deploy/main.py +++ b/github_deploy/main.py @@ -32,7 +32,8 @@ def get_command(self, ctx, name): main = GithubDeploy( help=( - "Deploy changes to multiple github repositories using a single command." + "Deploy changes to multiple github repositories using " + "a single command." ), ) From 4e671c1d4f873e545f361aac75d7e9011973c32d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 14:23:14 +0000 Subject: [PATCH 11/67] Bump codacy/codacy-analysis-cli-action from 1.1.0 to 4.0.2 Bumps [codacy/codacy-analysis-cli-action](https://github.com/codacy/codacy-analysis-cli-action) from 1.1.0 to 4.0.2. - [Release notes](https://github.com/codacy/codacy-analysis-cli-action/releases) - [Commits](https://github.com/codacy/codacy-analysis-cli-action/compare/d840f886c4bd4edc059706d09c6a1586111c540b...f38648320929161d81646834fbee4d75f6502aea) --- updated-dependencies: - dependency-name: codacy/codacy-analysis-cli-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 8be0fdb..f810d5b 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -39,7 +39,7 @@ jobs: # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b + uses: codacy/codacy-analysis-cli-action@f38648320929161d81646834fbee4d75f6502aea with: # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository # You can also omit the token and run the tools that support default configurations From b9715b362f6988b787c85a0dda4e7c7a3865ed4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Jul 2022 13:54:49 +0000 Subject: [PATCH 12/67] Bump tj-actions/github-changelog-generator from 1.13 to 1.14 Bumps [tj-actions/github-changelog-generator](https://github.com/tj-actions/github-changelog-generator) from 1.13 to 1.14. - [Release notes](https://github.com/tj-actions/github-changelog-generator/releases) - [Changelog](https://github.com/tj-actions/github-changelog-generator/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/github-changelog-generator/compare/v1.13...v1.14) --- updated-dependencies: - dependency-name: tj-actions/github-changelog-generator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 07d47a7..128dd03 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -43,7 +43,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - name: Generate CHANGELOG - uses: tj-actions/github-changelog-generator@v1.13 + uses: tj-actions/github-changelog-generator@v1.14 - name: Create Pull Request uses: peter-evans/create-pull-request@v4 From 8cea3ff63f1597a36f78054918f37220a9528384 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Aug 2022 13:34:20 +0000 Subject: [PATCH 13/67] Bump codacy/codacy-analysis-cli-action from 4.0.2 to 4.1 Bumps [codacy/codacy-analysis-cli-action](https://github.com/codacy/codacy-analysis-cli-action) from 4.0.2 to 4.1. - [Release notes](https://github.com/codacy/codacy-analysis-cli-action/releases) - [Commits](https://github.com/codacy/codacy-analysis-cli-action/compare/f38648320929161d81646834fbee4d75f6502aea...8abcaf1b06f1d9bd44d5795bbc679440aeb6ea7c) --- updated-dependencies: - dependency-name: codacy/codacy-analysis-cli-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index f810d5b..7a1f3c7 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -39,7 +39,7 @@ jobs: # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@f38648320929161d81646834fbee4d75f6502aea + uses: codacy/codacy-analysis-cli-action@8abcaf1b06f1d9bd44d5795bbc679440aeb6ea7c with: # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository # You can also omit the token and run the tools that support default configurations From 95173a798da6914f37087f226ce90bacdaeb18db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 14:04:34 +0000 Subject: [PATCH 14/67] Bump tj-actions/github-changelog-generator from 1.14 to 1.15 Bumps [tj-actions/github-changelog-generator](https://github.com/tj-actions/github-changelog-generator) from 1.14 to 1.15. - [Release notes](https://github.com/tj-actions/github-changelog-generator/releases) - [Changelog](https://github.com/tj-actions/github-changelog-generator/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/github-changelog-generator/compare/v1.14...v1.15) --- updated-dependencies: - dependency-name: tj-actions/github-changelog-generator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 128dd03..07043bd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -43,7 +43,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - name: Generate CHANGELOG - uses: tj-actions/github-changelog-generator@v1.14 + uses: tj-actions/github-changelog-generator@v1.15 - name: Create Pull Request uses: peter-evans/create-pull-request@v4 From c798e54eab872457dbd3f2b237b97eb72d979a9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Sep 2022 14:06:50 +0000 Subject: [PATCH 15/67] Bump tj-actions/semver-diff from 2.0.0 to 2.1.0 Bumps [tj-actions/semver-diff](https://github.com/tj-actions/semver-diff) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/tj-actions/semver-diff/releases) - [Changelog](https://github.com/tj-actions/semver-diff/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/semver-diff/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: tj-actions/semver-diff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 07043bd..43ab2a6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,7 @@ jobs: - name: Run semver-diff id: semver-diff - uses: tj-actions/semver-diff@v2.0.0 + uses: tj-actions/semver-diff@v2.1.0 - name: Set up Python uses: actions/setup-python@v4 From ee15f717637f88f982373b90dd6824fb0788b1c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Sep 2022 14:16:40 +0000 Subject: [PATCH 16/67] Bump codacy/codacy-analysis-cli-action from 4.1.0 to 4.2.0 Bumps [codacy/codacy-analysis-cli-action](https://github.com/codacy/codacy-analysis-cli-action) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/codacy/codacy-analysis-cli-action/releases) - [Commits](https://github.com/codacy/codacy-analysis-cli-action/compare/8abcaf1b06f1d9bd44d5795bbc679440aeb6ea7c...d43127fe38d20c527dc1951ae5aea23148bab738) --- updated-dependencies: - dependency-name: codacy/codacy-analysis-cli-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 7a1f3c7..ae02244 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -39,7 +39,7 @@ jobs: # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@8abcaf1b06f1d9bd44d5795bbc679440aeb6ea7c + uses: codacy/codacy-analysis-cli-action@d43127fe38d20c527dc1951ae5aea23148bab738 with: # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository # You can also omit the token and run the tools that support default configurations From 8d073c6c41d0349cebfef45fd5b6ba42a2707865 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 13:36:14 +0000 Subject: [PATCH 17/67] Bump pascalgn/automerge-action from 0.15.3 to 0.15.5 Bumps [pascalgn/automerge-action](https://github.com/pascalgn/automerge-action) from 0.15.3 to 0.15.5. - [Release notes](https://github.com/pascalgn/automerge-action/releases) - [Commits](https://github.com/pascalgn/automerge-action/compare/v0.15.3...v0.15.5) --- updated-dependencies: - dependency-name: pascalgn/automerge-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 59f687f..cb1f956 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -16,7 +16,7 @@ jobs: github.actor == 'renovate' steps: - name: automerge - uses: pascalgn/automerge-action@v0.15.3 + uses: pascalgn/automerge-action@v0.15.5 env: GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} MERGE_METHOD: "rebase" From 1e5dd2923c720e0ac13a68af00c5e379bb16be7a Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 26 Oct 2022 15:47:06 -0600 Subject: [PATCH 18/67] fix: bug with listing repositories --- github_deploy/commands/_http_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github_deploy/commands/_http_utils.py b/github_deploy/commands/_http_utils.py index d736fe7..2cb9ae2 100644 --- a/github_deploy/commands/_http_utils.py +++ b/github_deploy/commands/_http_utils.py @@ -55,8 +55,8 @@ async def delete(*, session, url, data, headers=None): async def list_repos(*, session, org, token): headers = { - "Authorization": "token {token}".format(token=token), - "Accept": "application/vnd.github.v3+json", + "Authorization": "Bearer {token}".format(token=token), + "Accept": "application/vnd.github+json", } url = REPOS_URL.format(org=org) click.echo("Retrieving repos at {}".format(url)) From c9c934b3438af459f6a27b14072050f5c177c16d Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 26 Oct 2022 15:52:19 -0600 Subject: [PATCH 19/67] Update delete.py --- github_deploy/commands/delete.py | 46 +------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/github_deploy/commands/delete.py b/github_deploy/commands/delete.py index 8ead88e..11742df 100644 --- a/github_deploy/commands/delete.py +++ b/github_deploy/commands/delete.py @@ -5,51 +5,7 @@ from github_deploy.commands._constants import BASE_URL from github_deploy.commands._http_utils import delete, get, list_repos -from github_deploy.commands._utils import get_repo - - -async def delete_content( - *, - session, - repo, - dest, - token, - semaphore, - exists, - current_sha, -): - headers = { - "Authorization": "token {token}".format(token=token), - "Accept": "application/vnd.github.v3+json", - } - - data = {"message": "Deleted {}".format(dest)} - if exists: - data["sha"] = current_sha - - url = BASE_URL.format(repo=repo, path=dest) - - async with semaphore: - response = await delete( - session=session, url=url, data=data, headers=headers - ) - - return response - - -async def check_exists(*, session, repo, dest, token, semaphore, skip_missing): - headers = {"Authorization": "token {token}".format(token=token)} - url = BASE_URL.format(repo=repo, path=dest) - - async with semaphore: - response = await get( - session=session, - url=url, - headers=headers, - skip_missing=skip_missing, - ) - - return response +from github_deploy.commands._utils import get_repo, delete_contents, check_exists async def handle_file_delete(*, repo, dest, token, semaphore, session): From a0e1ffd7058bc221e174feaf17bc3c58e6784f74 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 26 Oct 2022 15:52:58 -0600 Subject: [PATCH 20/67] Update delete.py --- github_deploy/commands/delete.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github_deploy/commands/delete.py b/github_deploy/commands/delete.py index 11742df..d3c2d50 100644 --- a/github_deploy/commands/delete.py +++ b/github_deploy/commands/delete.py @@ -4,8 +4,8 @@ import asyncclick as click from github_deploy.commands._constants import BASE_URL -from github_deploy.commands._http_utils import delete, get, list_repos -from github_deploy.commands._utils import get_repo, delete_contents, check_exists +from github_deploy.commands._http_utils import delete, get, list_repos, delete_contents, check_exists +from github_deploy.commands._utils import get_repo async def handle_file_delete(*, repo, dest, token, semaphore, session): From d8700bac284d6181abf95e72719ea04543eb1556 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 26 Oct 2022 15:54:17 -0600 Subject: [PATCH 21/67] Update _http_utils.py --- github_deploy/commands/_http_utils.py | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/github_deploy/commands/_http_utils.py b/github_deploy/commands/_http_utils.py index 2cb9ae2..0dd699d 100644 --- a/github_deploy/commands/_http_utils.py +++ b/github_deploy/commands/_http_utils.py @@ -62,3 +62,47 @@ async def list_repos(*, session, org, token): click.echo("Retrieving repos at {}".format(url)) response = await get(session=session, url=url, headers=headers) return response + + +async def delete_content( + *, + session, + repo, + dest, + token, + semaphore, + exists, + current_sha, +): + headers = { + "Authorization": "Bearer {token}".format(token=token), + "Accept": "application/vnd.github+json", + } + + data = {"message": "Deleted {}".format(dest)} + if exists: + data["sha"] = current_sha + + url = BASE_URL.format(repo=repo, path=dest) + + async with semaphore: + response = await delete( + session=session, url=url, data=data, headers=headers + ) + + return response + + +async def check_exists(*, session, repo, dest, token, semaphore, skip_missing): + headers = {"Authorization": "Bearer {token}".format(token=token)} + url = BASE_URL.format(repo=repo, path=dest) + + async with semaphore: + response = await get( + session=session, + url=url, + headers=headers, + skip_missing=skip_missing, + ) + + return response From e9cedafca476c69ae7af4b82def339981760c89d Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 28 Oct 2022 08:06:37 -0600 Subject: [PATCH 22/67] chore: reformatted and restructured modules --- github_deploy/commands/_http_utils.py | 60 +---------------- github_deploy/commands/_repo_utils.py | 93 +++++++++++++++++++++++++++ github_deploy/commands/_utils.py | 7 ++ github_deploy/commands/delete.py | 3 +- github_deploy/commands/upload.py | 65 +------------------ 5 files changed, 103 insertions(+), 125 deletions(-) create mode 100644 github_deploy/commands/_repo_utils.py diff --git a/github_deploy/commands/_http_utils.py b/github_deploy/commands/_http_utils.py index 0dd699d..539b9ec 100644 --- a/github_deploy/commands/_http_utils.py +++ b/github_deploy/commands/_http_utils.py @@ -1,9 +1,6 @@ import ssl -import certifi - -import asyncclick as click -from github_deploy.commands._constants import REPOS_URL +import certifi async def get(*, session, url, headers=None, skip_missing=False): @@ -51,58 +48,3 @@ async def delete(*, session, url, data, headers=None): ) as response: value = await response.json() return value - - -async def list_repos(*, session, org, token): - headers = { - "Authorization": "Bearer {token}".format(token=token), - "Accept": "application/vnd.github+json", - } - url = REPOS_URL.format(org=org) - click.echo("Retrieving repos at {}".format(url)) - response = await get(session=session, url=url, headers=headers) - return response - - -async def delete_content( - *, - session, - repo, - dest, - token, - semaphore, - exists, - current_sha, -): - headers = { - "Authorization": "Bearer {token}".format(token=token), - "Accept": "application/vnd.github+json", - } - - data = {"message": "Deleted {}".format(dest)} - if exists: - data["sha"] = current_sha - - url = BASE_URL.format(repo=repo, path=dest) - - async with semaphore: - response = await delete( - session=session, url=url, data=data, headers=headers - ) - - return response - - -async def check_exists(*, session, repo, dest, token, semaphore, skip_missing): - headers = {"Authorization": "Bearer {token}".format(token=token)} - url = BASE_URL.format(repo=repo, path=dest) - - async with semaphore: - response = await get( - session=session, - url=url, - headers=headers, - skip_missing=skip_missing, - ) - - return response diff --git a/github_deploy/commands/_repo_utils.py b/github_deploy/commands/_repo_utils.py new file mode 100644 index 0000000..ac6c068 --- /dev/null +++ b/github_deploy/commands/_repo_utils.py @@ -0,0 +1,93 @@ +import base64 + +import aiofiles +import asyncclick as click + +from github_deploy.commands._constants import REPOS_URL, BASE_URL +from github_deploy.commands._http_utils import get, delete, put +from github_deploy.commands._utils import get_headers + + +async def list_repos(*, session, org, token): + url = REPOS_URL.format(org=org) + click.echo("Retrieving repos at {}".format(url)) + response = await get(session=session, url=url, headers=get_headers(token=token)) + return response + + +async def delete_content( + *, + session, + repo, + dest, + token, + semaphore, + exists, + current_sha, +): + data = {"message": "Deleted {}".format(dest)} + if exists: + data["sha"] = current_sha + + url = BASE_URL.format(repo=repo, path=dest) + + async with semaphore: + response = await delete( + session=session, url=url, data=data, headers=get_headers(token=token) + ) + + return response + + +async def check_exists(*, session, repo, dest, token, semaphore, skip_missing): + url = BASE_URL.format(repo=repo, path=dest) + + async with semaphore: + response = await get( + session=session, + url=url, + headers=get_headers(token=token), + skip_missing=skip_missing, + ) + + return response + + +async def upload_content( + *, + session, + repo, + source, + dest, + token, + semaphore, + exists, + current_sha, + current_content +): + async with semaphore: + async with aiofiles.open(source, mode="rb") as f: + output = await f.read() + base64_content = base64.b64encode(output).decode("ascii") + + if current_content == base64_content: + click.echo("Skipping: Contents are the same.") + return + + data = { + "message": "Updated {}".format(dest) + if exists + else "Added {}".format(dest), + "content": base64_content, + } + if exists: + data["sha"] = current_sha + + url = BASE_URL.format(repo=repo, path=dest) + + async with semaphore: + response = await put( + session=session, url=url, data=data, headers=get_headers(token=token) + ) + + return response diff --git a/github_deploy/commands/_utils.py b/github_deploy/commands/_utils.py index 109bd3f..3289654 100644 --- a/github_deploy/commands/_utils.py +++ b/github_deploy/commands/_utils.py @@ -8,3 +8,10 @@ def can_upload(*, repo, include_private): if include_private and repo["private"] is True else not repo["private"] ) + + +def get_headers(*, token): + return { + "Authorization": "Bearer {token}".format(token=token), + "Accept": "application/vnd.github+json", + } diff --git a/github_deploy/commands/delete.py b/github_deploy/commands/delete.py index d3c2d50..9cafec6 100644 --- a/github_deploy/commands/delete.py +++ b/github_deploy/commands/delete.py @@ -3,8 +3,7 @@ import aiohttp import asyncclick as click -from github_deploy.commands._constants import BASE_URL -from github_deploy.commands._http_utils import delete, get, list_repos, delete_contents, check_exists +from github_deploy.commands._repo_utils import list_repos, delete_content, check_exists from github_deploy.commands._utils import get_repo diff --git a/github_deploy/commands/upload.py b/github_deploy/commands/upload.py index fe58e6d..3baf4a3 100644 --- a/github_deploy/commands/upload.py +++ b/github_deploy/commands/upload.py @@ -1,75 +1,12 @@ import asyncio -import base64 -import aiofiles import aiohttp import asyncclick as click -from github_deploy.commands._constants import BASE_URL -from github_deploy.commands._http_utils import put, list_repos, get +from github_deploy.commands._repo_utils import list_repos, check_exists, upload_content from github_deploy.commands._utils import get_repo, can_upload -async def upload_content( - *, - session, - repo, - source, - dest, - token, - semaphore, - exists, - current_sha, - current_content -): - headers = { - "Authorization": "token {token}".format(token=token), - "Accept": "application/vnd.github.v3+json", - } - - async with semaphore: - async with aiofiles.open(source, mode="rb") as f: - output = await f.read() - base64_content = base64.b64encode(output).decode("ascii") - - if current_content == base64_content: - click.echo("Skipping: Contents are the same.") - return - - data = { - "message": "Updated {}".format(dest) - if exists - else "Added {}".format(dest), - "content": base64_content, - } - if exists: - data["sha"] = current_sha - - url = BASE_URL.format(repo=repo, path=dest) - - async with semaphore: - response = await put( - session=session, url=url, data=data, headers=headers - ) - - return response - - -async def check_exists(*, session, repo, dest, token, semaphore, skip_missing): - headers = {"Authorization": "token {token}".format(token=token)} - url = BASE_URL.format(repo=repo, path=dest) - - async with semaphore: - response = await get( - session=session, - url=url, - headers=headers, - skip_missing=skip_missing, - ) - - return response - - async def handle_file_upload( *, repo, source, dest, overwrite, token, semaphore, session ): From 1742c2d98774c57bc57a4f6059113a203d0f253d Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 28 Oct 2022 08:16:15 -0600 Subject: [PATCH 23/67] re-order imports --- github_deploy/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/github_deploy/main.py b/github_deploy/main.py index c7cce59..246c985 100644 --- a/github_deploy/main.py +++ b/github_deploy/main.py @@ -1,6 +1,7 @@ -import asyncclick as click import os +import asyncclick as click + plugin_folder = os.path.join(os.path.dirname(__file__), "commands") From d360ac3d702b753b6d08f217a17e332d82304146 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 28 Oct 2022 08:32:03 -0600 Subject: [PATCH 24/67] Update dependabot.yml --- .github/dependabot.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index afb98ae..ae760f7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,12 @@ version: 2 updates: -- package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + - package-ecosystem: pip + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 From e52d6685555b2ace63aaaaf2c98cc03146966d86 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 28 Oct 2022 08:33:59 -0600 Subject: [PATCH 25/67] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2904151..ef3339f 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ release: dist ## package and upload a release @twine upload dist/* dist: clean install-deploy ## builds source and wheel package - @pip install twine==3.4.1 + @pip install twine @python setup.py sdist bdist_wheel increase-version: guard-PART ## Increase project version From 7bebc153d4076034cabd1019341a8e41cd2a410f Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 28 Oct 2022 08:41:15 -0600 Subject: [PATCH 26/67] Updated build target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ef3339f..ca6e713 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ release: dist ## package and upload a release dist: clean install-deploy ## builds source and wheel package @pip install twine - @python setup.py sdist bdist_wheel + @python -m build increase-version: guard-PART ## Increase project version @bump2version $(PART) From 64bdf4846dd79c82b091243da4d79b86e1773031 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 28 Oct 2022 09:02:36 -0600 Subject: [PATCH 27/67] chore: upgrade required python version to 3.7 --- .github/workflows/deploy.yml | 2 +- github_deploy/commands/_repo_utils.py | 8 ++++---- github_deploy/commands/_utils.py | 4 ++-- github_deploy/commands/delete.py | 4 ++-- github_deploy/main.py | 2 +- setup.py | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 43ab2a6..b02f205 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.6.x' + python-version: '3.7.x' - name: Upgrade pip run: pip install -U pip diff --git a/github_deploy/commands/_repo_utils.py b/github_deploy/commands/_repo_utils.py index ac6c068..438d970 100644 --- a/github_deploy/commands/_repo_utils.py +++ b/github_deploy/commands/_repo_utils.py @@ -10,7 +10,7 @@ async def list_repos(*, session, org, token): url = REPOS_URL.format(org=org) - click.echo("Retrieving repos at {}".format(url)) + click.echo(f"Retrieving repos at {url}") response = await get(session=session, url=url, headers=get_headers(token=token)) return response @@ -25,7 +25,7 @@ async def delete_content( exists, current_sha, ): - data = {"message": "Deleted {}".format(dest)} + data = {"message": f"Deleted {dest}"} if exists: data["sha"] = current_sha @@ -75,9 +75,9 @@ async def upload_content( return data = { - "message": "Updated {}".format(dest) + "message": f"Updated {dest}" if exists - else "Added {}".format(dest), + else f"Added {dest}", "content": base64_content, } if exists: diff --git a/github_deploy/commands/_utils.py b/github_deploy/commands/_utils.py index 3289654..afc4b79 100644 --- a/github_deploy/commands/_utils.py +++ b/github_deploy/commands/_utils.py @@ -1,5 +1,5 @@ def get_repo(*, org, project): - return "{org}/{project}".format(project=project, org=org) + return f"{org}/{project}" def can_upload(*, repo, include_private): @@ -12,6 +12,6 @@ def can_upload(*, repo, include_private): def get_headers(*, token): return { - "Authorization": "Bearer {token}".format(token=token), + "Authorization": f"Bearer {token}", "Accept": "application/vnd.github+json", } diff --git a/github_deploy/commands/delete.py b/github_deploy/commands/delete.py index 9cafec6..9b7209e 100644 --- a/github_deploy/commands/delete.py +++ b/github_deploy/commands/delete.py @@ -51,7 +51,7 @@ async def handle_file_delete(*, repo, dest, token, semaphore, session): ) return click.style( - "No content found at {repo}/{dest}".format(repo=repo, dest=dest), + f"No content found at {repo}/{dest}", fg="blue", bold=True, ) @@ -100,7 +100,7 @@ async def main(org, token, dest): ) click.echo( click.style( - 'Deleting "{path}" for all repositories:'.format(path=dest), + f'Deleting "{dest}" for all repositories:', fg="blue", ) ) diff --git a/github_deploy/main.py b/github_deploy/main.py index 246c985..c93ad51 100644 --- a/github_deploy/main.py +++ b/github_deploy/main.py @@ -28,7 +28,7 @@ def get_command(self, ctx, name): eval(code, ns, ns) return ns["main"] - ctx.fail("Invalid Command \"{name}\"".format(name=name)) + ctx.fail(f"Invalid Command \"{name}\"") main = GithubDeploy( diff --git a/setup.py b/setup.py index 5369b06..b8719f4 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ author_email="jtonye@ymail.com", license="MIT", packages=find_packages(), - python_requires=">=3.6", + python_requires=">=3.7", extras_require=extras_require, install_requires=[ "asyncclick", From 6d810b26a0531069b5cad139338a85082d39ff6a Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 28 Oct 2022 09:39:14 -0600 Subject: [PATCH 28/67] Updated Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ca6e713..b7e4461 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ release: dist ## package and upload a release @twine upload dist/* dist: clean install-deploy ## builds source and wheel package - @pip install twine + @pip install build twine @python -m build increase-version: guard-PART ## Increase project version From c48e87b4774587b9cb45c95d8fcf4ad74abaf556 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 28 Oct 2022 16:10:09 +0000 Subject: [PATCH 29/67] =?UTF-8?q?Bump=20version:=201.0.1=20=E2=86=92=201.0?= =?UTF-8?q?.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 741cf0e..3134a53 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.1 +current_version = 1.0.2 commit = True tag = False diff --git a/setup.py b/setup.py index b8719f4..ade0984 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( name="github-deploy", - version="1.0.1", + version="1.0.2", description="Deploy yaml files to a large number of repositories in seconds.", long_description=LONG_DESCRIPTION, long_description_content_type=LONG_DESCRIPTION_TYPE, From ca369c2531e64a3980fbfcee3a75b0b747fccd39 Mon Sep 17 00:00:00 2001 From: jackton1 Date: Fri, 28 Oct 2022 16:10:36 +0000 Subject: [PATCH 30/67] =?UTF-8?q?Upgraded=20from=20v1.0.1=20=E2=86=92=20v1?= =?UTF-8?q?.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27a9493..5c2b4fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [v1.0.2](https://github.com/tj-python/github-deploy/tree/v1.0.2) (2022-10-28) + +[Full Changelog](https://github.com/tj-python/github-deploy/compare/v1.0.1...v1.0.2) + +**Merged pull requests:** + +- chore: upgrade required python version to 3.7 [\#27](https://github.com/tj-python/github-deploy/pull/27) ([jackton1](https://github.com/jackton1)) +- chore: reformatted and restructured modules [\#26](https://github.com/tj-python/github-deploy/pull/26) ([jackton1](https://github.com/jackton1)) +- fix: bug with listing repositories [\#25](https://github.com/tj-python/github-deploy/pull/25) ([jackton1](https://github.com/jackton1)) +- Bump pascalgn/automerge-action from 0.15.3 to 0.15.5 [\#24](https://github.com/tj-python/github-deploy/pull/24) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump codacy/codacy-analysis-cli-action from 4.1.0 to 4.2.0 [\#23](https://github.com/tj-python/github-deploy/pull/23) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump tj-actions/semver-diff from 2.0.0 to 2.1.0 [\#22](https://github.com/tj-python/github-deploy/pull/22) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump tj-actions/github-changelog-generator from 1.14 to 1.15 [\#21](https://github.com/tj-python/github-deploy/pull/21) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump codacy/codacy-analysis-cli-action from 4.0.2 to 4.1 [\#20](https://github.com/tj-python/github-deploy/pull/20) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump tj-actions/github-changelog-generator from 1.13 to 1.14 [\#19](https://github.com/tj-python/github-deploy/pull/19) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump codacy/codacy-analysis-cli-action from 1.1.0 to 4.0.2 [\#18](https://github.com/tj-python/github-deploy/pull/18) ([dependabot[bot]](https://github.com/apps/dependabot)) +- chore: Fixed lint errors. [\#17](https://github.com/tj-python/github-deploy/pull/17) ([jackton1](https://github.com/jackton1)) +- Update README.md [\#16](https://github.com/tj-python/github-deploy/pull/16) ([jackton1](https://github.com/jackton1)) +- Upgraded v1.0.0 → v1.0.1 [\#15](https://github.com/tj-python/github-deploy/pull/15) ([jackton1](https://github.com/jackton1)) + ## [v1.0.1](https://github.com/tj-python/github-deploy/tree/v1.0.1) (2022-06-12) [Full Changelog](https://github.com/tj-python/github-deploy/compare/v1.0.0...v1.0.1) From 9402f0d566e1e396a4a033319b6d10b14bd343bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 13:20:46 +0000 Subject: [PATCH 31/67] Bump hmarr/auto-approve-action from 2 to 3 Bumps [hmarr/auto-approve-action](https://github.com/hmarr/auto-approve-action) from 2 to 3. - [Release notes](https://github.com/hmarr/auto-approve-action/releases) - [Commits](https://github.com/hmarr/auto-approve-action/compare/v2...v3) --- updated-dependencies: - dependency-name: hmarr/auto-approve-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-approve.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index d537315..0de2e3d 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -7,7 +7,7 @@ jobs: auto-approve: runs-on: ubuntu-latest steps: - - uses: hmarr/auto-approve-action@v2 + - uses: hmarr/auto-approve-action@v3 if: | ( github.event.pull_request.user.login == 'dependabot[bot]' || From 42a650de335f53a7811843461ef9c3d05b45af7d Mon Sep 17 00:00:00 2001 From: LGTM Migrator Date: Wed, 7 Dec 2022 11:56:58 +0000 Subject: [PATCH 32/67] Add CodeQL workflow for GitHub code scanning --- .github/workflows/codeql.yml | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..4e26255 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,41 @@ +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: "32 0 * * 4" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ python ] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + queries: +security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{ matrix.language }}" From 6b459aae74a4708cf360a50d3b3737acb1a6504b Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 30 Dec 2022 23:40:58 -0700 Subject: [PATCH 33/67] feat: add support for updating existing files --- github_deploy/commands/_constants.py | 2 +- github_deploy/commands/_repo_utils.py | 26 +++++-- github_deploy/commands/upload.py | 97 ++++++++++++++++----------- 3 files changed, 79 insertions(+), 46 deletions(-) diff --git a/github_deploy/commands/_constants.py b/github_deploy/commands/_constants.py index 1249c71..a8fb431 100644 --- a/github_deploy/commands/_constants.py +++ b/github_deploy/commands/_constants.py @@ -1,2 +1,2 @@ REPOS_URL = "https://api.github.com/search/repositories?q=org:{org}" -BASE_URL = "https://api.github.com/repos/{repo}/contents/{path}" +FILE_CONTENTS_URL = "https://api.github.com/repos/{repo}/contents/{path}" diff --git a/github_deploy/commands/_repo_utils.py b/github_deploy/commands/_repo_utils.py index 438d970..64b7d55 100644 --- a/github_deploy/commands/_repo_utils.py +++ b/github_deploy/commands/_repo_utils.py @@ -1,9 +1,11 @@ import base64 +import os import aiofiles import asyncclick as click +from aiofiles import os as aiofiles_os -from github_deploy.commands._constants import REPOS_URL, BASE_URL +from github_deploy.commands._constants import REPOS_URL, FILE_CONTENTS_URL from github_deploy.commands._http_utils import get, delete, put from github_deploy.commands._utils import get_headers @@ -29,7 +31,7 @@ async def delete_content( if exists: data["sha"] = current_sha - url = BASE_URL.format(repo=repo, path=dest) + url = FILE_CONTENTS_URL.format(repo=repo, path=dest) async with semaphore: response = await delete( @@ -40,7 +42,7 @@ async def delete_content( async def check_exists(*, session, repo, dest, token, semaphore, skip_missing): - url = BASE_URL.format(repo=repo, path=dest) + url = FILE_CONTENTS_URL.format(repo=repo, path=dest) async with semaphore: response = await get( @@ -62,6 +64,7 @@ async def upload_content( token, semaphore, exists, + only_update, current_sha, current_content ): @@ -73,6 +76,19 @@ async def upload_content( if current_content == base64_content: click.echo("Skipping: Contents are the same.") return + else: + if exists: + click.echo("Storing backup of existing file...") + + dirname, filename = os.path.split(f"{repo}/{dest}") + + await aiofiles_os.makedirs(dirname, exist_ok=True) + + async with aiofiles.open(f"{dirname}/{filename}", mode="wb") as f: + await f.write(base64.b64decode(current_content)) + elif only_update: + click.echo(f"Skipping: only updating existing files.") + return data = { "message": f"Updated {dest}" @@ -83,7 +99,9 @@ async def upload_content( if exists: data["sha"] = current_sha - url = BASE_URL.format(repo=repo, path=dest) + url = FILE_CONTENTS_URL.format(repo=repo, path=dest) + + click.echo(f"Uploading {source} to {repo}/{dest}...") async with semaphore: response = await put( diff --git a/github_deploy/commands/upload.py b/github_deploy/commands/upload.py index 3baf4a3..9d2e32d 100644 --- a/github_deploy/commands/upload.py +++ b/github_deploy/commands/upload.py @@ -8,7 +8,7 @@ async def handle_file_upload( - *, repo, source, dest, overwrite, token, semaphore, session + *, repo, source, dest, overwrite, only_update, token, semaphore, session ): check_exists_response = await check_exists( session=session, @@ -23,19 +23,18 @@ async def handle_file_upload( current_content = check_exists_response.get("content") exists = current_sha is not None - if exists and not overwrite: - return click.style( - "Skipped uploading {source} to {repo}/{path}: Found an existing copy.".format( - source=source, - repo=repo, - path=dest, - ), - fg="blue", - bold=True, - ) - - else: - if exists: + if exists: + if not overwrite: + return click.style( + "Skipped uploading {source} to {repo}/{path}: Found an existing copy.".format( + source=source, + repo=repo, + path=dest, + ), + fg="blue", + bold=True, + ) + else: click.echo( click.style( "Found an existing copy at {repo}/{path} overwriting it's contents...".format( @@ -45,36 +44,32 @@ async def handle_file_upload( ), ) - upload_response = await upload_content( - session=session, - repo=repo, - source=source, - dest=dest, - token=token, - semaphore=semaphore, - exists=exists, - current_sha=current_sha, - current_content=current_content, - ) + upload_response = await upload_content( + session=session, + repo=repo, + source=source, + dest=dest, + token=token, + semaphore=semaphore, + exists=exists, + only_update=only_update, + current_sha=current_sha, + current_content=current_content, + ) - if upload_response: - return click.style( - "Successfully uploaded '{source}' to {repo}/{dest}".format( - source=upload_response["content"]["name"], - repo=repo, - dest=upload_response["content"]["path"], - ), - fg="green", - bold=True, - ) + if upload_response: + return click.style( + "Successfully uploaded '{source}' to {repo}/{dest}".format( + source=upload_response["content"]["name"], + repo=repo, + dest=upload_response["content"]["path"], + ), + fg="green", + bold=True, + ) @click.command() -@click.option( - "--org", - prompt=click.style("Enter your github user/organization", bold=True), - help="The github organization.", -) @click.option( "--token", prompt=click.style("Enter your personal access token", bold=True), @@ -82,6 +77,11 @@ async def handle_file_upload( hide_input=True, envvar="TOKEN", ) +@click.option( + "--org", + prompt=click.style("Enter your github user/organization", bold=True), + help="The github organization.", +) @click.option( "--source", prompt=click.style("Enter path to source file", fg="blue"), @@ -98,16 +98,30 @@ async def handle_file_upload( prompt=click.style( "Should we overwrite existing contents at this path", fg="blue" ), + is_flag=True, + show_default=True, help="Overwrite existing files.", default=False, ) +@click.option( + "--only-update/--no-only-update", + prompt=click.style( + "Should we only update existing files at this path", fg="blue" + ), + is_flag=True, + show_default=True, + help="Only update existing files.", + default=False, +) @click.option( "--private/--no-private", prompt=click.style("Should we Include private repositories", bold=True), + is_flag=True, + show_default=True, help="Upload files to private repositories.", default=True, ) -async def main(org, token, source, dest, overwrite, private): +async def main(org, token, source, dest, overwrite, only_update, private): """Upload a file to all repositories owned by an organization/user.""" # create instance of Semaphore: max concurrent requests. semaphore = asyncio.Semaphore(1000) @@ -171,6 +185,7 @@ async def main(org, token, source, dest, overwrite, private): dest=dest, token=token, overwrite=overwrite, + only_update=only_update, session=session, semaphore=semaphore, ) From c0382775f1ab59e1ed664062ea1351144ac3d75d Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 31 Dec 2022 13:33:29 -0700 Subject: [PATCH 34/67] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 2f9fd94..616b83d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ [![PyPI version](https://badge.fury.io/py/github-deploy.svg)](https://badge.fury.io/py/github-deploy) [![Upload Python Package](https://github.com/tj-python/github-deploy/actions/workflows/deploy.yml/badge.svg)](https://github.com/tj-python/github-deploy/actions/workflows/deploy.yml) [![Downloads](https://pepy.tech/badge/github-deploy)](https://pepy.tech/project/github-deploy) -[![Total alerts](https://img.shields.io/lgtm/alerts/g/tj-python/github-deploy.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/tj-python/github-deploy/alerts/) -[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/tj-python/github-deploy.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/tj-python/github-deploy/context:python) # github-deploy From ff87ab59d76f5da1fae38a723b95562b5f8ee9b4 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 31 Dec 2022 13:38:37 -0700 Subject: [PATCH 35/67] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 616b83d..7cda288 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ [![PyPI version](https://badge.fury.io/py/github-deploy.svg)](https://badge.fury.io/py/github-deploy) [![Upload Python Package](https://github.com/tj-python/github-deploy/actions/workflows/deploy.yml/badge.svg)](https://github.com/tj-python/github-deploy/actions/workflows/deploy.yml) [![Downloads](https://pepy.tech/badge/github-deploy)](https://pepy.tech/project/github-deploy) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/867aeabe457f4367b9e0013b713add6b)](https://www.codacy.com/gh/tj-python/github-deploy/dashboard?utm_source=github.com&utm_medium=referral&utm_content=tj-python/github-deploy&utm_campaign=Badge_Grade) + # github-deploy ## Using [polyrepo's](https://github.com/joelparkerhenderson/monorepo_vs_polyrepo#what-is-polyrepo) to manage projects ? From 043435d93e4c53e53637404e89a76e7a3f5b5b35 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 31 Dec 2022 13:59:09 -0700 Subject: [PATCH 36/67] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 7cda288..7e9c63a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/867aeabe457f4367b9e0013b713add6b)](https://www.codacy.com/gh/tj-python/github-deploy/dashboard?utm_source=github.com&utm_medium=referral&utm_content=tj-python/github-deploy&utm_campaign=Badge_Grade) [![PyPI version](https://badge.fury.io/py/github-deploy.svg)](https://badge.fury.io/py/github-deploy) [![Upload Python Package](https://github.com/tj-python/github-deploy/actions/workflows/deploy.yml/badge.svg)](https://github.com/tj-python/github-deploy/actions/workflows/deploy.yml) [![Downloads](https://pepy.tech/badge/github-deploy)](https://pepy.tech/project/github-deploy) -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/867aeabe457f4367b9e0013b713add6b)](https://www.codacy.com/gh/tj-python/github-deploy/dashboard?utm_source=github.com&utm_medium=referral&utm_content=tj-python/github-deploy&utm_campaign=Badge_Grade) - # github-deploy ## Using [polyrepo's](https://github.com/joelparkerhenderson/monorepo_vs_polyrepo#what-is-polyrepo) to manage projects ? From 462164a114f91d17a78ed7c5ace5f3b956d3b010 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 5 Jan 2023 22:06:16 -0700 Subject: [PATCH 37/67] feat: update api url and add new features --- github_deploy/commands/_constants.py | 2 +- github_deploy/commands/_repo_utils.py | 40 +++++++++++++++++++++------ github_deploy/commands/delete.py | 2 +- github_deploy/commands/upload.py | 24 ++++++++++------ 4 files changed, 49 insertions(+), 19 deletions(-) diff --git a/github_deploy/commands/_constants.py b/github_deploy/commands/_constants.py index a8fb431..ab4c9ba 100644 --- a/github_deploy/commands/_constants.py +++ b/github_deploy/commands/_constants.py @@ -1,2 +1,2 @@ -REPOS_URL = "https://api.github.com/search/repositories?q=org:{org}" +REPOS_URL = "https://api.github.com/users/{org}/repos" FILE_CONTENTS_URL = "https://api.github.com/repos/{repo}/contents/{path}" diff --git a/github_deploy/commands/_repo_utils.py b/github_deploy/commands/_repo_utils.py index 64b7d55..9d42286 100644 --- a/github_deploy/commands/_repo_utils.py +++ b/github_deploy/commands/_repo_utils.py @@ -1,9 +1,8 @@ import base64 import os -import aiofiles import asyncclick as click -from aiofiles import os as aiofiles_os +from aiofiles import os as aiofiles_os, open as aiofiles_open from github_deploy.commands._constants import REPOS_URL, FILE_CONTENTS_URL from github_deploy.commands._http_utils import get, delete, put @@ -69,25 +68,44 @@ async def upload_content( current_content ): async with semaphore: - async with aiofiles.open(source, mode="rb") as f: + async with aiofiles_open(source, mode="rb") as f: output = await f.read() base64_content = base64.b64encode(output).decode("ascii") if current_content == base64_content: - click.echo("Skipping: Contents are the same.") + click.echo( + click.style( + f"Skipping {source} to {repo}/{dest}: No changes detected.", + fg="yellow", + bold=True, + ) + ) return else: if exists: - click.echo("Storing backup of existing file...") + click.echo( + click.style( + "Storing backup of existing file at {repo}/{path}...".format( + repo=repo, path=dest + ), + fg="cyan", + ), + ) dirname, filename = os.path.split(f"{repo}/{dest}") await aiofiles_os.makedirs(dirname, exist_ok=True) - async with aiofiles.open(f"{dirname}/{filename}", mode="wb") as f: + async with aiofiles_open(f"{dirname}/{filename}", mode="wb") as f: await f.write(base64.b64decode(current_content)) elif only_update: - click.echo(f"Skipping: only updating existing files.") + click.echo( + click.style( + f"Updates only: Skipped uploading {source} to {repo}/{dest}. File does not exist.", + fg="yellow", + bold=True, + ) + ) return data = { @@ -101,7 +119,13 @@ async def upload_content( url = FILE_CONTENTS_URL.format(repo=repo, path=dest) - click.echo(f"Uploading {source} to {repo}/{dest}...") + click.echo( + click.style( + f"Uploading {source} to {repo}/{dest}...", + fg="green", + bold=True, + ) + ) async with semaphore: response = await put( diff --git a/github_deploy/commands/delete.py b/github_deploy/commands/delete.py index 9b7209e..f34a8ef 100644 --- a/github_deploy/commands/delete.py +++ b/github_deploy/commands/delete.py @@ -87,7 +87,7 @@ async def main(org, token, dest): response = await list_repos(org=org, token=token, session=session) repos = [ get_repo(org=org, project=v["name"]) - for v in response["items"] + for v in response if not v["archived"] ] click.echo( diff --git a/github_deploy/commands/upload.py b/github_deploy/commands/upload.py index 9d2e32d..52813b0 100644 --- a/github_deploy/commands/upload.py +++ b/github_deploy/commands/upload.py @@ -25,7 +25,7 @@ async def handle_file_upload( if exists: if not overwrite: - return click.style( + click.style( "Skipped uploading {source} to {repo}/{path}: Found an existing copy.".format( source=source, repo=repo, @@ -132,7 +132,7 @@ async def main(org, token, source, dest, overwrite, only_update, private): response = await list_repos(org=org, token=token, session=session) repos = [ get_repo(org=org, project=r["name"]) - for r in response["items"] + for r in response if not r["archived"] and can_upload(repo=r, include_private=private) ] @@ -156,15 +156,21 @@ async def main(org, token, source, dest, overwrite, only_update, private): fg="bright_red", ) ) - deploy_msg = ( - 'Deploying "{source}" to "{path}" for all repositories'.format( - source=source, path=dest - ) - if overwrite - else 'Deploying "{source}" to repositories that don\'t already have contents at "{path}"'.format( + + if overwrite: + if only_update: + deploy_msg = "Updating '{source}' for existing files located at '{dest}'".format( + source=source, dest=dest + ) + else: + deploy_msg = "Overwriting '{dest}' with '{source}'".format( + source=source, dest=dest + ) + else: + deploy_msg = "Deploying '{source}' to repositories that don\'t already have contents at '{path}'".format( source=source, path=dest ) - ) + click.echo(click.style(deploy_msg, fg="blue")) c = click.prompt(click.style("Continue? [YN] ", fg="blue")) From b2644ff1aa6c0242c31d475f7b8846bfb7a3301e Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 5 Jan 2023 22:12:48 -0700 Subject: [PATCH 38/67] Update _repo_utils.py --- github_deploy/commands/_repo_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github_deploy/commands/_repo_utils.py b/github_deploy/commands/_repo_utils.py index 9d42286..a7aa389 100644 --- a/github_deploy/commands/_repo_utils.py +++ b/github_deploy/commands/_repo_utils.py @@ -75,7 +75,7 @@ async def upload_content( if current_content == base64_content: click.echo( click.style( - f"Skipping {source} to {repo}/{dest}: No changes detected.", + f"Skipped uploading {source} to {repo}/{dest}: No changes detected.", fg="yellow", bold=True, ) From d9aff7c39b755e32686e728c69c1e1d25d5ea0fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Dec 2022 13:09:36 +0000 Subject: [PATCH 39/67] Bump tj-actions/github-changelog-generator from 1.15 to 1.17 Bumps [tj-actions/github-changelog-generator](https://github.com/tj-actions/github-changelog-generator) from 1.15 to 1.17. - [Release notes](https://github.com/tj-actions/github-changelog-generator/releases) - [Changelog](https://github.com/tj-actions/github-changelog-generator/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/github-changelog-generator/compare/v1.15...v1.17) --- updated-dependencies: - dependency-name: tj-actions/github-changelog-generator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b02f205..da3a297 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -43,7 +43,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - name: Generate CHANGELOG - uses: tj-actions/github-changelog-generator@v1.15 + uses: tj-actions/github-changelog-generator@v1.17 - name: Create Pull Request uses: peter-evans/create-pull-request@v4 From 4be31e15e0061f70ce98011c5c7afdc7d2e3f69d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Jan 2023 05:24:38 +0000 Subject: [PATCH 40/67] =?UTF-8?q?Bump=20version:=201.0.2=20=E2=86=92=201.1?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 3134a53..071afdc 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.2 +current_version = 1.1.0 commit = True tag = False diff --git a/setup.py b/setup.py index ade0984..bfe6bce 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( name="github-deploy", - version="1.0.2", + version="1.1.0", description="Deploy yaml files to a large number of repositories in seconds.", long_description=LONG_DESCRIPTION, long_description_content_type=LONG_DESCRIPTION_TYPE, From fd9a9cfca7f6e505a361a1d66a243465314ded54 Mon Sep 17 00:00:00 2001 From: jackton1 Date: Fri, 6 Jan 2023 05:25:10 +0000 Subject: [PATCH 41/67] =?UTF-8?q?Upgraded=20from=20v1.0.2=20=E2=86=92=20v1?= =?UTF-8?q?.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c2b4fa..6391492 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [v1.1.0](https://github.com/tj-python/github-deploy/tree/v1.1.0) (2023-01-06) + +[Full Changelog](https://github.com/tj-python/github-deploy/compare/v1.0.2...v1.1.0) + +**Merged pull requests:** + +- feat: update api url and add new features [\#36](https://github.com/tj-python/github-deploy/pull/36) ([jackton1](https://github.com/jackton1)) +- feat: add support for updating existing files [\#32](https://github.com/tj-python/github-deploy/pull/32) ([jackton1](https://github.com/jackton1)) +- Bump tj-actions/github-changelog-generator from 1.15 to 1.17 [\#31](https://github.com/tj-python/github-deploy/pull/31) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Add CodeQL workflow for GitHub code scanning [\#30](https://github.com/tj-python/github-deploy/pull/30) ([lgtm-com[bot]](https://github.com/apps/lgtm-com)) +- Bump hmarr/auto-approve-action from 2 to 3 [\#29](https://github.com/tj-python/github-deploy/pull/29) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Upgraded v1.0.1 → v1.0.2 [\#28](https://github.com/tj-python/github-deploy/pull/28) ([jackton1](https://github.com/jackton1)) + ## [v1.0.2](https://github.com/tj-python/github-deploy/tree/v1.0.2) (2022-10-28) [Full Changelog](https://github.com/tj-python/github-deploy/compare/v1.0.1...v1.0.2) From b5e29bd8de109ff49c24da7c3896cbc75e1d6a0d Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 5 Jan 2023 22:47:30 -0700 Subject: [PATCH 42/67] Update deploy.yml --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index da3a297..9d50d02 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -50,6 +50,7 @@ jobs: with: base: "main" title: "Upgraded ${{ steps.semver-diff.outputs.old_version }} → ${{ steps.semver-diff.outputs.new_version }}" + labels: "merge when passing" branch: "chore/upgrade-${{ steps.semver-diff.outputs.old_version }}-to-${{ steps.semver-diff.outputs.new_version }}" commit-message: "Upgraded from ${{ steps.semver-diff.outputs.old_version }} → ${{ steps.semver-diff.outputs.new_version }}" body: "View [CHANGES](https://github.com/${{ github.repository }}/compare/${{ steps.semver-diff.outputs.old_version }}...${{ steps.semver-diff.outputs.new_version }})" From 0e3fa71071e09e3c7c9a87b69a45428eaa375651 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jan 2023 13:08:16 +0000 Subject: [PATCH 43/67] Bump tj-actions/semver-diff from 2.1.0 to 2.4.0 Bumps [tj-actions/semver-diff](https://github.com/tj-actions/semver-diff) from 2.1.0 to 2.4.0. - [Release notes](https://github.com/tj-actions/semver-diff/releases) - [Changelog](https://github.com/tj-actions/semver-diff/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/semver-diff/compare/v2.1.0...v2.4.0) --- updated-dependencies: - dependency-name: tj-actions/semver-diff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9d50d02..cfb3012 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,7 @@ jobs: - name: Run semver-diff id: semver-diff - uses: tj-actions/semver-diff@v2.1.0 + uses: tj-actions/semver-diff@v2.4.0 - name: Set up Python uses: actions/setup-python@v4 From a6e4d135197df57e07306e32b0999e27919f357d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jan 2023 13:10:52 +0000 Subject: [PATCH 44/67] Bump tj-actions/semver-diff from 2.4.0 to 2.4.1 Bumps [tj-actions/semver-diff](https://github.com/tj-actions/semver-diff) from 2.4.0 to 2.4.1. - [Release notes](https://github.com/tj-actions/semver-diff/releases) - [Changelog](https://github.com/tj-actions/semver-diff/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/semver-diff/compare/v2.4.0...v2.4.1) --- updated-dependencies: - dependency-name: tj-actions/semver-diff dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cfb3012..4450885 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,7 @@ jobs: - name: Run semver-diff id: semver-diff - uses: tj-actions/semver-diff@v2.4.0 + uses: tj-actions/semver-diff@v2.4.1 - name: Set up Python uses: actions/setup-python@v4 From 6c830a404854c572232440098798298839ff0ab9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 14:16:29 +0000 Subject: [PATCH 45/67] Bump pascalgn/automerge-action from 0.15.5 to 0.15.6 Bumps [pascalgn/automerge-action](https://github.com/pascalgn/automerge-action) from 0.15.5 to 0.15.6. - [Release notes](https://github.com/pascalgn/automerge-action/releases) - [Commits](https://github.com/pascalgn/automerge-action/compare/v0.15.5...v0.15.6) --- updated-dependencies: - dependency-name: pascalgn/automerge-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index cb1f956..ac0ee08 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -16,7 +16,7 @@ jobs: github.actor == 'renovate' steps: - name: automerge - uses: pascalgn/automerge-action@v0.15.5 + uses: pascalgn/automerge-action@v0.15.6 env: GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} MERGE_METHOD: "rebase" From 1e0fd8ce1f21ab282ef8dcad98e70c32f041fea7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:03:55 +0000 Subject: [PATCH 46/67] Bump codacy/codacy-analysis-cli-action from 4.2.0 to 4.3.0 Bumps [codacy/codacy-analysis-cli-action](https://github.com/codacy/codacy-analysis-cli-action) from 4.2.0 to 4.3.0. - [Release notes](https://github.com/codacy/codacy-analysis-cli-action/releases) - [Commits](https://github.com/codacy/codacy-analysis-cli-action/compare/d43127fe38d20c527dc1951ae5aea23148bab738...5cc54a75f9ad88159bb54046196d920e40e367a5) --- updated-dependencies: - dependency-name: codacy/codacy-analysis-cli-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index ae02244..b05fc81 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -39,7 +39,7 @@ jobs: # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@d43127fe38d20c527dc1951ae5aea23148bab738 + uses: codacy/codacy-analysis-cli-action@5cc54a75f9ad88159bb54046196d920e40e367a5 with: # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository # You can also omit the token and run the tools that support default configurations From 519afabada10029a347f72cf14b04c340b6f3567 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Mar 2023 14:03:00 +0000 Subject: [PATCH 47/67] Bump tj-actions/github-changelog-generator from 1.17 to 1.18 Bumps [tj-actions/github-changelog-generator](https://github.com/tj-actions/github-changelog-generator) from 1.17 to 1.18. - [Release notes](https://github.com/tj-actions/github-changelog-generator/releases) - [Changelog](https://github.com/tj-actions/github-changelog-generator/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/github-changelog-generator/compare/v1.17...v1.18) --- updated-dependencies: - dependency-name: tj-actions/github-changelog-generator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4450885..1d1de4a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -43,7 +43,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - name: Generate CHANGELOG - uses: tj-actions/github-changelog-generator@v1.17 + uses: tj-actions/github-changelog-generator@v1.18 - name: Create Pull Request uses: peter-evans/create-pull-request@v4 From 6644ff12c48bd36ff29128ca7a4d4fcf3db926a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 14:01:31 +0000 Subject: [PATCH 48/67] Bump peter-evans/create-pull-request from 4 to 5 Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4 to 5. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v4...v5) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1d1de4a..486d3e5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -46,7 +46,7 @@ jobs: uses: tj-actions/github-changelog-generator@v1.18 - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@v5 with: base: "main" title: "Upgraded ${{ steps.semver-diff.outputs.old_version }} → ${{ steps.semver-diff.outputs.new_version }}" From 94378b71cbaf9a8591678e8a071762f03450a465 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 1 May 2023 17:26:39 +0000 Subject: [PATCH 49/67] =?UTF-8?q?Bump=20version:=201.1.0=20=E2=86=92=201.1?= =?UTF-8?q?.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 071afdc..7821942 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.1.0 +current_version = 1.1.1 commit = True tag = False diff --git a/setup.py b/setup.py index bfe6bce..ce167a8 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( name="github-deploy", - version="1.1.0", + version="1.1.1", description="Deploy yaml files to a large number of repositories in seconds.", long_description=LONG_DESCRIPTION, long_description_content_type=LONG_DESCRIPTION_TYPE, From 9c40149dac3905bd8a6876aaa36124e81682ddb0 Mon Sep 17 00:00:00 2001 From: jackton1 Date: Mon, 1 May 2023 17:27:18 +0000 Subject: [PATCH 50/67] =?UTF-8?q?Upgraded=20from=20v1.1.0=20=E2=86=92=20v1?= =?UTF-8?q?.1.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6391492..12d4f52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [v1.1.1](https://github.com/tj-python/github-deploy/tree/v1.1.1) (2023-04-05) + +[Full Changelog](https://github.com/tj-python/github-deploy/compare/v1.1.0...v1.1.1) + +**Merged pull requests:** + +- Bump peter-evans/create-pull-request from 4 to 5 [\#43](https://github.com/tj-python/github-deploy/pull/43) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump tj-actions/github-changelog-generator from 1.17 to 1.18 [\#42](https://github.com/tj-python/github-deploy/pull/42) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump codacy/codacy-analysis-cli-action from 4.2.0 to 4.3.0 [\#41](https://github.com/tj-python/github-deploy/pull/41) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump pascalgn/automerge-action from 0.15.5 to 0.15.6 [\#40](https://github.com/tj-python/github-deploy/pull/40) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump tj-actions/semver-diff from 2.4.0 to 2.4.1 [\#39](https://github.com/tj-python/github-deploy/pull/39) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump tj-actions/semver-diff from 2.1.0 to 2.4.0 [\#38](https://github.com/tj-python/github-deploy/pull/38) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Upgraded v1.0.2 → v1.1.0 [\#37](https://github.com/tj-python/github-deploy/pull/37) ([jackton1](https://github.com/jackton1)) + ## [v1.1.0](https://github.com/tj-python/github-deploy/tree/v1.1.0) (2023-01-06) [Full Changelog](https://github.com/tj-python/github-deploy/compare/v1.0.2...v1.1.0) From b99592853ce51f236f1c8a2d56db80f6a63a4016 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 May 2023 14:04:12 +0000 Subject: [PATCH 51/67] Bump tj-actions/github-changelog-generator from 1.18 to 1.19 Bumps [tj-actions/github-changelog-generator](https://github.com/tj-actions/github-changelog-generator) from 1.18 to 1.19. - [Release notes](https://github.com/tj-actions/github-changelog-generator/releases) - [Changelog](https://github.com/tj-actions/github-changelog-generator/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/github-changelog-generator/compare/v1.18...v1.19) --- updated-dependencies: - dependency-name: tj-actions/github-changelog-generator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 486d3e5..1a6978f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -43,7 +43,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - name: Generate CHANGELOG - uses: tj-actions/github-changelog-generator@v1.18 + uses: tj-actions/github-changelog-generator@v1.19 - name: Create Pull Request uses: peter-evans/create-pull-request@v5 From 0360603519a54c7bd118affd428589d7184b3ad3 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 5 Jul 2023 12:08:43 -0600 Subject: [PATCH 52/67] Delete auto-merge.yml --- .github/workflows/auto-merge.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/workflows/auto-merge.yml diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml deleted file mode 100644 index ac0ee08..0000000 --- a/.github/workflows/auto-merge.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: automerge -on: - check_suite: - types: - - completed - -jobs: - automerge: - runs-on: ubuntu-latest - if: | - github.actor == 'dependabot[bot]' || - github.actor == 'dependabot' || - github.actor == 'dependabot-preview[bot]' || - github.actor == 'dependabot-preview' || - github.actor == 'renovate[bot]' || - github.actor == 'renovate' - steps: - - name: automerge - uses: pascalgn/automerge-action@v0.15.6 - env: - GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} - MERGE_METHOD: "rebase" - UPDATE_METHOD: "rebase" - MERGE_RETRIES: "6" - MERGE_RETRY_SLEEP: "100000" - MERGE_LABELS: "" From 2364108f4830ae629261791a99dbdb529fba603f Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 5 Jul 2023 12:09:18 -0600 Subject: [PATCH 53/67] Update dependabot.yml --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ae760f7..0e0584e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,8 +5,12 @@ updates: schedule: interval: daily open-pull-requests-limit: 10 + labels: + - "merge when passing" - package-ecosystem: pip directory: "/" schedule: interval: daily open-pull-requests-limit: 10 + labels: + - "merge when passing" From 37d65b7920448444cfa66ef59687999acda38d75 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 5 Jul 2023 12:11:56 -0600 Subject: [PATCH 54/67] Update _constants.py --- github_deploy/commands/_constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github_deploy/commands/_constants.py b/github_deploy/commands/_constants.py index ab4c9ba..174b0a3 100644 --- a/github_deploy/commands/_constants.py +++ b/github_deploy/commands/_constants.py @@ -1,2 +1,2 @@ -REPOS_URL = "https://api.github.com/users/{org}/repos" +REPOS_URL = "https://api.github.com/users/{org}/repos?per_page=100" FILE_CONTENTS_URL = "https://api.github.com/repos/{repo}/contents/{path}" From ea7387d9ed4467db8243ac6577da16167e37a3b0 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 5 Jul 2023 12:12:38 -0600 Subject: [PATCH 55/67] =?UTF-8?q?Upgraded=20v1.1.1=20=E2=86=92=20v1.1.2=20?= =?UTF-8?q?(#46)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: github-actions[bot] Co-authored-by: jackton1 --- .bumpversion.cfg | 2 +- CHANGELOG.md | 19 ++++++++++++++----- setup.py | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 7821942..3e6afd8 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.1.1 +current_version = 1.1.2 commit = True tag = False diff --git a/CHANGELOG.md b/CHANGELOG.md index 12d4f52..0e9673f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [v1.1.2](https://github.com/tj-python/github-deploy/tree/v1.1.2) (2023-05-29) + +[Full Changelog](https://github.com/tj-python/github-deploy/compare/v1.1.1...v1.1.2) + +**Merged pull requests:** + +- Bump tj-actions/github-changelog-generator from 1.18 to 1.19 [\#45](https://github.com/tj-python/github-deploy/pull/45) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Upgraded v1.1.0 → v1.1.1 [\#44](https://github.com/tj-python/github-deploy/pull/44) ([jackton1](https://github.com/jackton1)) + ## [v1.1.1](https://github.com/tj-python/github-deploy/tree/v1.1.1) (2023-04-05) [Full Changelog](https://github.com/tj-python/github-deploy/compare/v1.1.0...v1.1.1) @@ -83,15 +92,15 @@ ## [0.0.7](https://github.com/tj-python/github-deploy/tree/0.0.7) (2021-11-15) -[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.6...0.0.7) +[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.5...0.0.7) -## [0.0.6](https://github.com/tj-python/github-deploy/tree/0.0.6) (2021-11-15) +## [0.0.5](https://github.com/tj-python/github-deploy/tree/0.0.5) (2021-11-15) -[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.5...0.0.6) +[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.6...0.0.5) -## [0.0.5](https://github.com/tj-python/github-deploy/tree/0.0.5) (2021-11-15) +## [0.0.6](https://github.com/tj-python/github-deploy/tree/0.0.6) (2021-11-15) -[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.4...0.0.5) +[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.4...0.0.6) **Merged pull requests:** diff --git a/setup.py b/setup.py index ce167a8..f561204 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( name="github-deploy", - version="1.1.1", + version="1.1.2", description="Deploy yaml files to a large number of repositories in seconds.", long_description=LONG_DESCRIPTION, long_description_content_type=LONG_DESCRIPTION_TYPE, From 3d3da192f2ebf7c2a6658bdc4e2a3b89c8d774d0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 5 Jul 2023 18:14:06 +0000 Subject: [PATCH 56/67] =?UTF-8?q?Bump=20version:=201.1.2=20=E2=86=92=201.2?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 3e6afd8..9f1c464 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.1.2 +current_version = 1.2.0 commit = True tag = False diff --git a/setup.py b/setup.py index f561204..29124f3 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( name="github-deploy", - version="1.1.2", + version="1.2.0", description="Deploy yaml files to a large number of repositories in seconds.", long_description=LONG_DESCRIPTION, long_description_content_type=LONG_DESCRIPTION_TYPE, From 44bdc67427b8f3ba5918aea629c51d49510d6966 Mon Sep 17 00:00:00 2001 From: jackton1 Date: Wed, 5 Jul 2023 18:14:33 +0000 Subject: [PATCH 57/67] =?UTF-8?q?Upgraded=20from=20v1.1.2=20=E2=86=92=20v1?= =?UTF-8?q?.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e9673f..18ef1cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [v1.2.0](https://github.com/tj-python/github-deploy/tree/v1.2.0) (2023-07-05) + +[Full Changelog](https://github.com/tj-python/github-deploy/compare/v1.1.2...v1.2.0) + +**Merged pull requests:** + +- Upgraded v1.1.1 → v1.1.2 [\#46](https://github.com/tj-python/github-deploy/pull/46) ([jackton1](https://github.com/jackton1)) + ## [v1.1.2](https://github.com/tj-python/github-deploy/tree/v1.1.2) (2023-05-29) [Full Changelog](https://github.com/tj-python/github-deploy/compare/v1.1.1...v1.1.2) @@ -92,15 +100,15 @@ ## [0.0.7](https://github.com/tj-python/github-deploy/tree/0.0.7) (2021-11-15) -[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.5...0.0.7) +[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.6...0.0.7) -## [0.0.5](https://github.com/tj-python/github-deploy/tree/0.0.5) (2021-11-15) +## [0.0.6](https://github.com/tj-python/github-deploy/tree/0.0.6) (2021-11-15) -[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.6...0.0.5) +[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.5...0.0.6) -## [0.0.6](https://github.com/tj-python/github-deploy/tree/0.0.6) (2021-11-15) +## [0.0.5](https://github.com/tj-python/github-deploy/tree/0.0.5) (2021-11-15) -[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.4...0.0.6) +[Full Changelog](https://github.com/tj-python/github-deploy/compare/0.0.4...0.0.5) **Merged pull requests:** From b169794f61e14b2735cd84dd1c3d27095b6cae94 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 31 Aug 2023 18:47:28 -0600 Subject: [PATCH 58/67] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e9c63a..b014e1a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/867aeabe457f4367b9e0013b713add6b)](https://www.codacy.com/gh/tj-python/github-deploy/dashboard?utm_source=github.com&utm_medium=referral&utm_content=tj-python/github-deploy&utm_campaign=Badge_Grade) [![PyPI version](https://badge.fury.io/py/github-deploy.svg)](https://badge.fury.io/py/github-deploy) -[![Upload Python Package](https://github.com/tj-python/github-deploy/actions/workflows/deploy.yml/badge.svg)](https://github.com/tj-python/github-deploy/actions/workflows/deploy.yml) [![Downloads](https://pepy.tech/badge/github-deploy)](https://pepy.tech/project/github-deploy) +[![Upload Python Package](https://github.com/tj-python/github-deploy/actions/workflows/deploy.yml/badge.svg)](https://github.com/tj-python/github-deploy/actions/workflows/deploy.yml) +[![Downloads](https://static.pepy.tech/badge/github-deploy)](https://pepy.tech/project/github-deploy) + + # github-deploy From 76957d093a96e0c541168687a0232bc4a6d38e41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 13:32:04 +0000 Subject: [PATCH 59/67] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codacy.yml | 2 +- .github/workflows/codeql.yml | 2 +- .github/workflows/deploy.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index b05fc81..5b4b6d5 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -35,7 +35,7 @@ jobs: steps: # Checkout the repository to the GitHub Actions runner - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 4e26255..d1b620d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1a6978f..6ffb56b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,7 +8,7 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 From 1b7a2f25ce08f69770b95e6c537e6fe74d065afb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 13:46:56 +0000 Subject: [PATCH 60/67] Bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6ffb56b..5d7e7f7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,7 +17,7 @@ jobs: uses: tj-actions/semver-diff@v2.4.1 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.7.x' From a8daa68ab24c5e9c1d4b2c2ee4e68db57584ceaf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 13:06:30 +0000 Subject: [PATCH 61/67] Bump github/codeql-action from 2 to 3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codacy.yml | 2 +- .github/workflows/codeql.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 5b4b6d5..9bdb42a 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -55,6 +55,6 @@ jobs: # Upload the SARIF file generated in the previous step - name: Upload SARIF results file - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: results.sarif diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d1b620d..74677b6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -27,15 +27,15 @@ jobs: uses: actions/checkout@v4 - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} queries: +security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{ matrix.language }}" From 374a2f20917f0ac18ae615ace90b004d15672311 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 13:48:58 +0000 Subject: [PATCH 62/67] Bump hmarr/auto-approve-action from 3 to 4 Bumps [hmarr/auto-approve-action](https://github.com/hmarr/auto-approve-action) from 3 to 4. - [Release notes](https://github.com/hmarr/auto-approve-action/releases) - [Commits](https://github.com/hmarr/auto-approve-action/compare/v3...v4) --- updated-dependencies: - dependency-name: hmarr/auto-approve-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-approve.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 0de2e3d..6c8dc38 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -7,7 +7,7 @@ jobs: auto-approve: runs-on: ubuntu-latest steps: - - uses: hmarr/auto-approve-action@v3 + - uses: hmarr/auto-approve-action@v4 if: | ( github.event.pull_request.user.login == 'dependabot[bot]' || From ec7f1f163f191d776529a71d2ca02e6beccc595f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 20:56:19 +0000 Subject: [PATCH 63/67] Bump peter-evans/create-pull-request from 5 to 6 Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5 to 6. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v5...v6) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5d7e7f7..57b86b7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -46,7 +46,7 @@ jobs: uses: tj-actions/github-changelog-generator@v1.19 - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v6 with: base: "main" title: "Upgraded ${{ steps.semver-diff.outputs.old_version }} → ${{ steps.semver-diff.outputs.new_version }}" From 420dd7cadb8674be728c95351419ec86b5b18c5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Feb 2024 13:22:52 +0000 Subject: [PATCH 64/67] Bump codacy/codacy-analysis-cli-action from 4.3.0 to 4.4.0 Bumps [codacy/codacy-analysis-cli-action](https://github.com/codacy/codacy-analysis-cli-action) from 4.3.0 to 4.4.0. - [Release notes](https://github.com/codacy/codacy-analysis-cli-action/releases) - [Commits](https://github.com/codacy/codacy-analysis-cli-action/compare/5cc54a75f9ad88159bb54046196d920e40e367a5...33d455949345bddfdb845fba76b57b70cc83754b) --- updated-dependencies: - dependency-name: codacy/codacy-analysis-cli-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 9bdb42a..2abe35b 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -39,7 +39,7 @@ jobs: # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@5cc54a75f9ad88159bb54046196d920e40e367a5 + uses: codacy/codacy-analysis-cli-action@33d455949345bddfdb845fba76b57b70cc83754b with: # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository # You can also omit the token and run the tools that support default configurations From 53e976dc612ef9058edfc73410f79ebad82a7999 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 13:47:23 +0000 Subject: [PATCH 65/67] Bump tj-actions/github-changelog-generator from 1.19 to 1.20 Bumps [tj-actions/github-changelog-generator](https://github.com/tj-actions/github-changelog-generator) from 1.19 to 1.20. - [Release notes](https://github.com/tj-actions/github-changelog-generator/releases) - [Changelog](https://github.com/tj-actions/github-changelog-generator/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/github-changelog-generator/compare/v1.19...v1.20) --- updated-dependencies: - dependency-name: tj-actions/github-changelog-generator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 57b86b7..864b728 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -43,7 +43,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - name: Generate CHANGELOG - uses: tj-actions/github-changelog-generator@v1.19 + uses: tj-actions/github-changelog-generator@v1.20 - name: Create Pull Request uses: peter-evans/create-pull-request@v6 From ac696bb4188fec3803a688bd70ff74106fe60280 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:25:51 +0000 Subject: [PATCH 66/67] Bump tj-actions/semver-diff from 2.4.1 to 3.0.1 Bumps [tj-actions/semver-diff](https://github.com/tj-actions/semver-diff) from 2.4.1 to 3.0.1. - [Release notes](https://github.com/tj-actions/semver-diff/releases) - [Changelog](https://github.com/tj-actions/semver-diff/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/semver-diff/compare/v2.4.1...v3.0.1) --- updated-dependencies: - dependency-name: tj-actions/semver-diff dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 864b728..2a6203f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,7 @@ jobs: - name: Run semver-diff id: semver-diff - uses: tj-actions/semver-diff@v2.4.1 + uses: tj-actions/semver-diff@v3.0.1 - name: Set up Python uses: actions/setup-python@v5 From 9b0f8702f48a42bd36f3fffa2982ea19f42dc3f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 13:13:38 +0000 Subject: [PATCH 67/67] Bump codacy/codacy-analysis-cli-action from 4.4.0 to 4.4.1 Bumps [codacy/codacy-analysis-cli-action](https://github.com/codacy/codacy-analysis-cli-action) from 4.4.0 to 4.4.1. - [Release notes](https://github.com/codacy/codacy-analysis-cli-action/releases) - [Commits](https://github.com/codacy/codacy-analysis-cli-action/compare/33d455949345bddfdb845fba76b57b70cc83754b...3ff8e64eb4b714c4bee91b7b4eea31c6fc2c4f93) --- updated-dependencies: - dependency-name: codacy/codacy-analysis-cli-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 2abe35b..127070e 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -39,7 +39,7 @@ jobs: # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@33d455949345bddfdb845fba76b57b70cc83754b + uses: codacy/codacy-analysis-cli-action@3ff8e64eb4b714c4bee91b7b4eea31c6fc2c4f93 with: # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository # You can also omit the token and run the tools that support default configurations