File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,12 +62,19 @@ jobs:
6262 - name : Grant Lambda access to ECR repository
6363 run : |
6464 set -euo pipefail
65- runtime="${{ env.RUNTIME_NAME }}"
66- repo=$(aws ecr describe-repositories \
67- --query 'repositories[].repositoryName' \
68- --output text | tr '\t' '\n' | grep "$runtime" | head -1)
65+ region="${{ steps.config.outputs.region }}"
66+ repo=$(python3 -c "
67+ import yaml, os, lithops
68+ with open(os.path.expanduser('~/.lithops/config')) as f:
69+ c = yaml.safe_load(f)
70+ user_id = c['aws_lambda']['user_id']
71+ user_key = user_id[-4:].lower()
72+ v = lithops.__version__.replace('.', '')
73+ print(f'lithops_v{v}_{user_key}/${{ env.RUNTIME_NAME }}')
74+ ")
6975 echo "Setting ECR policy on: $repo"
7076 aws ecr set-repository-policy \
77+ --region "$region" \
7178 --repository-name "$repo" \
7279 --policy-text '{
7380 "Version": "2012-10-17",
You can’t perform that action at this time.
0 commit comments