Skip to content

Commit

Permalink
fix: missing action parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
MS-elug committed Jun 5, 2024
1 parent 1ace1d2 commit 7b8f1e4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
13 changes: 12 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ inputs:
description: 'TED Flavor'
required: true
default: 'unit-tests' # can be 'unit-tests', 'python2-3-migration'
github-repository: # flavor of TED to use
description: 'Github repository (ower/repo) to work on'
required: true
push:
description: 'Enable git push and PR creation'
required: false
default: 'true'
runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -23,4 +30,8 @@ runs:
- -b
- ${{ inputs.git-branch }}
- -f
- ${{ inputs.ted-flavor }}
- ${{ inputs.ted-flavor }}
- -ghr
- ${{ inputs.github-repository }}
- -p
- ${{ inputs.push }}
17 changes: 9 additions & 8 deletions ted.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ def main():
arguments = parse_arguments()

git_url = arguments.git_repo
github_token = arguments.github_token
branch = arguments.branch
github_token = os.getenv('GITHUB_TOKEN')
branch = arguments.git_branch
push = arguments.push
github_repository = arguments.github_repository
ted_flavor = arguments.ted_flavor

Expand Down Expand Up @@ -102,7 +103,7 @@ def main():
print("Run generation")
generator.run_generation(retriever, llm, output_parser, clone_path)

if(github_repository and branch and github_token):
if(push and github_repository and branch and github_token):
GitHelper().push_changes_in_pull_request(github_repository, "ted: suggestions", "feat/ted_suggestions", branch, github_token)

def filter_files(file_path, extensions):
Expand All @@ -127,18 +128,18 @@ def parse_arguments():

optional_args = parser.add_argument_group('optional arguments')

required_args.add_argument('-r', '--git-repo', type=str, help='The Git repo URL',
required_args.add_argument('-r', '--git_repo', type=str, help='The Git repo URL',
required=False)

optional_args.add_argument('-b', '--branch', type=str, help='Optional, The branch to use as base',
required=False)

optional_args.add_argument('-gh', '--github_token', type=str, help='Optional, Github token to create branch and open a pull request',
optional_args.add_argument('-b', '--git_branch', type=str, help='Optional, The branch to use as base',
required=False)

optional_args.add_argument('-ghr', '--github_repository', type=str, help='Optional, Github repository (owner/repo)',
required=False)

optional_args.add_argument('-p', '--push', type=str, help='Optional, Github repository (owner/repo)',
required=False)

return parser.parse_args()


Expand Down

0 comments on commit 7b8f1e4

Please sign in to comment.