Skip to content

Commit

Permalink
[WIP] updates github action
Browse files Browse the repository at this point in the history
  • Loading branch information
KreutzerCode committed Jan 10, 2024
1 parent 85bf396 commit 5570f62
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,10 @@ jobs:
LATEST_RELEASE=$(curl --silent -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r .upload_url | cut -d "{" -f 1)
echo "::set-output name=upload_url::$LATEST_RELEASE"
- name: Get asset ID
id: get_asset_id
- name: Log asset_path and asset_name
run: |
RELEASE_ID=$(echo "${{ steps.latest_release.outputs.upload_url }}" | sed -r "s/.*\/releases\/([0-9]+)\/assets/\1/")
ASSET_ID=$(curl --silent -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets" | jq '.[] | select(.name=="wp-wingman") | .id')
echo "::set-output name=asset_id::$ASSET_ID"
- name: Delete existing asset
run: |
curl -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/releases/assets/${{ steps.get_asset_id.outputs.asset_id }}"
echo "asset_path: ${{ inputs.asset_path }}"
echo "asset_name: ${{ inputs.asset_name }}"
- name: Upload Release Asset
id: upload-release-asset
Expand Down

0 comments on commit 5570f62

Please sign in to comment.