Skip to content

Commit e04764c

Browse files
committed
Revert "Fix issue when running as an action as --last-commit-age-days is quoted"
This reverts commit d878b41.
1 parent 68b93df commit e04764c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ jobs:
2525
action_container \
2626
--github-token="${{ github.token }}"
2727
28-
- name: "Test: ignore branch 'test_prefix/two' and don't fail on quoted --last-commit-age-days"
28+
- name: "Test: ignore branch 'test_prefix/two'"
2929
run: |
3030
docker run --rm -t \
3131
-e GITHUB_REPOSITORY \
3232
-e GITHUB_OUTPUT \
3333
-v "${GITHUB_OUTPUT}:${GITHUB_OUTPUT}" \
3434
action_container \
3535
--ignore-branches="test_prefix/two" \
36-
--last-commit-age-days="9" \
36+
--last-commit-age-days=9 \
3737
--dry-run=yes \
3838
--github-token="${{ github.token }}"
3939

src/io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ def get_args() -> argparse.Namespace:
4444
help="The API base url to be used in requests to GitHub Enterprise"
4545
)
4646

47-
# Not setting `type=int` to avoid issues when it's passed as a quoted string
4847
parser.add_argument(
4948
"--last-commit-age-days",
5049
help="How old in days must be the last commit into the branch for the branch to be deleted",
5150
default=60,
51+
type=int,
5252
)
5353

5454
parser.add_argument(
@@ -78,7 +78,7 @@ def parse_input(self) -> Options:
7878

7979
return Options(
8080
ignore_branches=ignore_branches,
81-
last_commit_age_days=int(args.last_commit_age_days),
81+
last_commit_age_days=args.last_commit_age_days,
8282
allowed_prefixes=allowed_prefixes,
8383
dry_run=dry_run,
8484
github_token=args.github_token,

0 commit comments

Comments
 (0)