Skip to content

Commit

Permalink
Fix LIFETIME in action.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Kulachenko <[email protected]>
  • Loading branch information
vvarg229 committed Oct 16, 2023
1 parent 6418f86 commit aeab4f3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ inputs:
URL_PREFIX:
description: Prefix to the url address for each of the files(objects)
required: false
EXPIRATION_PERIOD:
description: Expiration period for PRs in epochs
LIFETIME:
description: Number of epochs for object to stay valid
required: false
default: 0

Expand Down Expand Up @@ -77,17 +77,17 @@ runs:
shell: bash
env:
NEOFS_NETWORK_DOMAIN: ${{ inputs.NEOFS_NETWORK_DOMAIN }}
EXPIRATION_PERIOD: ${{ inputs.EXPIRATION_PERIOD }}
LIFETIME: ${{ inputs.LIFETIME }}
run: |
if [[ "$EXPIRATION_PERIOD" =~ ^[0-9]+$ ]]; then
if [[ "$EXPIRATION_PERIOD" -eq "0" ]]; then
if [[ "$LIFETIME" =~ ^[0-9]+$ ]]; then
if [[ "$LIFETIME" -eq "0" ]]; then
EXP_EPOCH=0
else
CURRENT_EPOCH=$(neofs-cli netmap epoch --rpc-endpoint $NEOFS_NETWORK_DOMAIN:8080)
EXP_EPOCH=$((EXPIRATION_PERIOD + CURRENT_EPOCH))
EXP_EPOCH=$((LIFETIME + CURRENT_EPOCH))
fi
else
echo "Error: EXPIRATION_PERIOD $EXPIRATION_PERIOD is not a valid number."
echo "Error: LIFETIME $LIFETIME is not a valid number."
exit 1
fi
echo "EXP_EPOCH=$EXP_EPOCH" >> $GITHUB_ENV
Expand Down

0 comments on commit aeab4f3

Please sign in to comment.