Skip to content

Commit

Permalink
Merge pull request #51 from rhettre/feature/release-workflow
Browse files Browse the repository at this point in the history
Update release-lambda.yml
  • Loading branch information
rhettre authored Jul 27, 2024
2 parents c30aa2e + 494e5af commit d91870f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/release-lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ jobs:
run: |
zip -r layer.zip ./
- name: Get Release by Tag
- name: Get Release
id: get_release
run: |
RELEASE_DATA=$(curl --request GET \
--url "https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ github.ref_name }}" \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'accept: application/vnd.github+json')
UPLOAD_URL=$(echo $RELEASE_DATA | jq -r .upload_url | sed 's/{?name,label}//')
echo "UPLOAD_URL=$UPLOAD_URL"
echo "::set-output name=upload_url::$UPLOAD_URL"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: context.ref.replace('refs/tags/', '')
});
core.setOutput('upload_url', release.data.upload_url);
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
Expand All @@ -46,5 +46,5 @@ jobs:
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./layer.zip
asset_name: layer.zip
asset_content_type: application/zip
asset_name: layer-${{ github.ref_name }}.zip
asset_content_type: application/zip

0 comments on commit d91870f

Please sign in to comment.