From e04764c2f0f714dedb80c42d5174e756568a0452 Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Mon, 11 Sep 2023 14:29:10 +0100 Subject: [PATCH] Revert "Fix issue when running as an action as --last-commit-age-days is quoted" This reverts commit d878b4136b35d578cfced29813d44723fcdbd6d2. --- .github/workflows/tests.yaml | 4 ++-- src/io.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 26f5eac..a3d9964 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,7 +25,7 @@ jobs: action_container \ --github-token="${{ github.token }}" - - name: "Test: ignore branch 'test_prefix/two' and don't fail on quoted --last-commit-age-days" + - name: "Test: ignore branch 'test_prefix/two'" run: | docker run --rm -t \ -e GITHUB_REPOSITORY \ @@ -33,7 +33,7 @@ jobs: -v "${GITHUB_OUTPUT}:${GITHUB_OUTPUT}" \ action_container \ --ignore-branches="test_prefix/two" \ - --last-commit-age-days="9" \ + --last-commit-age-days=9 \ --dry-run=yes \ --github-token="${{ github.token }}" diff --git a/src/io.py b/src/io.py index 1dc954f..8e1ad85 100644 --- a/src/io.py +++ b/src/io.py @@ -44,11 +44,11 @@ def get_args() -> argparse.Namespace: help="The API base url to be used in requests to GitHub Enterprise" ) - # Not setting `type=int` to avoid issues when it's passed as a quoted string parser.add_argument( "--last-commit-age-days", help="How old in days must be the last commit into the branch for the branch to be deleted", default=60, + type=int, ) parser.add_argument( @@ -78,7 +78,7 @@ def parse_input(self) -> Options: return Options( ignore_branches=ignore_branches, - last_commit_age_days=int(args.last_commit_age_days), + last_commit_age_days=args.last_commit_age_days, allowed_prefixes=allowed_prefixes, dry_run=dry_run, github_token=args.github_token,