Skip to content

Commit

Permalink
Merge pull request #22 from usefulness/updates
Browse files Browse the repository at this point in the history
Pass through unrecognised values
  • Loading branch information
mateuszkwiecinski authored May 26, 2024
2 parents 0127c46 + 8084ae7 commit aecea9c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ The action only exposes multiple `output`s containing latest version for each AG
#### Simple usage:
```yml
jobs:
actual-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
javaVersion: [ 21 ]
gradle: [ current, release-candidate ]
agp: ["stable", "rc", "alpha"]

actual-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
javaVersion: [ 21 ]
gradle: [ current, release-candidate ]
agp: [ "stable", "rc", "alpha" ]
steps:
- id: agp-version-finder
uses: usefulness/agp-version-finder-action@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
required: false
default: 'false'
version-to-resolve:
description: 'Has to be one of `stable`, `alpha`, `beta`, `rc`. Will be translated into specific version, available under `outputs.resolved-version`'
description: 'Has to be one of `stable`, `alpha`, `beta`, `rc`. Will be translated into specific version, available under `outputs.resolved-version`. Unrecognised values will be passed through to the output for convenience'
required: false

outputs:
Expand All @@ -24,7 +24,7 @@ outputs:
description: "Returns latest stable AGP version"
value: ${{ steps.run-action.outputs.latest-stable }}
resolved-version:
description: "Actual semver version resolved from `version-to-resolve`"
description: "Semver version resolved from `version-to-resolve`"
value: ${{ steps.run-action.outputs.resolved-version }}

branding:
Expand Down
6 changes: 2 additions & 4 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def github_output(key, value):
latest_rc = all_rc[-1]

version_to_resolve = os.getenv("INPUT_VERSION_TO_RESOLVE", "").strip()
if version_to_resolve == "":
resolved_version = ""
elif version_to_resolve in ["stable", "current"]:
if version_to_resolve in ["stable", "current"]:
resolved_version = latest_stable
elif version_to_resolve == "alpha":
resolved_version = latest_alpha
Expand All @@ -61,7 +59,7 @@ def github_output(key, value):
elif version_to_resolve in ["release-candidate", "rc"]:
resolved_version = latest_rc
else:
raise Exception("Unrecognised `version-to-resolve` input value. Has to be one of [`stable`, `alpha`, `beta`, `rc`]")
resolved_version = version_to_resolve # pass through

github_output(key="latest-stable", value=latest_stable)
github_output(key="latest-alpha", value=latest_alpha)
Expand Down

0 comments on commit aecea9c

Please sign in to comment.