Skip to content

Commit

Permalink
Revert "Fix issue when running as an action as --last-commit-age-days…
Browse files Browse the repository at this point in the history
… is quoted"

This reverts commit d878b41.
  • Loading branch information
luispabon committed Sep 11, 2023
1 parent 68b93df commit e04764c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ 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 \
-e GITHUB_OUTPUT \
-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 }}"
Expand Down
4 changes: 2 additions & 2 deletions src/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e04764c

Please sign in to comment.