From 512e7539d79ed82e8b0e5176861ab9ca598ae234 Mon Sep 17 00:00:00 2001 From: Caden Helbling Date: Mon, 19 Feb 2024 11:36:51 -0600 Subject: [PATCH] update version tag retrieval method --- .github/workflows/larch_to_s3.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/larch_to_s3.yml b/.github/workflows/larch_to_s3.yml index 99d94fc..4012ae9 100644 --- a/.github/workflows/larch_to_s3.yml +++ b/.github/workflows/larch_to_s3.yml @@ -21,23 +21,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Get release tag name - id: get_tag_name - run: echo "RELEASE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV + - name: Get latest release tag + id: get_latest_tag + run: | + TOKEN="${{ secrets.GITHUB_TOKEN }}" + VERSION=$(curl -s -H "Authorization: Bearer $TOKEN" "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r .tag_name) + echo "RELEASE_TAG=${VERSION}" >> $GITHUB_ENV - name: Zip repository run: | zip -r "larch_${RELEASE_TAG}.zip" . zip -r "larch_latest.zip" . - - name: ConfigureAWS Credentials + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::067782713062:role/admin-oidc - role-session-name: ${{ github.repository_owner}} + role-session-name: ${{ github.repository_owner }} aws-region: us-east-1 - name: Upload to S3 run: | aws s3 cp "./larch_${RELEASE_TAG}.zip" s3://impact-repo-dependencies/larch/ - aws s3 cp "./larch_latest.zip" s3://impact-repo-dependencies/larch/ \ No newline at end of file + aws s3 cp "./larch_latest.zip" s3://impact-repo-dependencies/larch/