Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Nov 11, 2021
1 parent 2beccf2 commit 6c47826
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
runs-on: ubuntu-18.04
steps:
- name: PREVIOUS_TAG_NAME
run: echo "PREVIOUS_TAG_NAME=$(curl -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)" >> $GITHUB_ENV
run: |
echo "PREVIOUS_TAG_NAME=$(curl -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)" >> $GITHUB_ENV
- name: TAG_NAME for schedule
if: github.event_name == 'schedule'
Expand Down Expand Up @@ -44,24 +45,28 @@ jobs:
</tbody>
</table>
draft: true
draft: false
prerelease: true
- name: RELEASE_BODY
if: github.event_name == 'schedule'
env:
TAG_NAME: ${{ env.TAG_NAME }}
run: echo "RELEASE_BODY=$(curl -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${{ github.repository }}/releases/tags/${TAG_NAME} | jq -r .body)" >> $GITHUB_ENV
run: |
echo 'RELEASE_BODY<<EOF' >> $GITHUB_ENV
echo $(curl -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ env.TAG_NAME }} | jq -r .body | sed 's,",\\",g' | sed "s,',\\',g") >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: RELEASE_ID
if: github.event_name == 'schedule'
env:
TAG_NAME: ${{ env.TAG_NAME }}
run: echo "RELEASE_ID=$(curl -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${{ github.repository }}/releases/tags/${TAG_NAME} | jq -r .id)" >> $GITHUB_ENV
run: |
echo "RELEASE_ID=$(curl -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ env.TAG_NAME }} | jq -r .id)" >> $GITHUB_ENV
- name: GENERATED_NOTES
if: github.event_name == 'schedule'
env:
TAG_NAME: ${{ env.TAG_NAME }}
PREVIOUS_TAG_NAME: ${{ env.PREVIOUS_TAG_NAME }}
run: echo "GENERATED_NOTES=$(curl -X POST -H 'Accept: application/vnd.github.v3+json' -H 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/generate-notes -d '{"tag_name":"'${TAG_NAME}'", "previous_tag_name":"'${PREVIOUS_TAG_NAME}'"}' | jq -r .body)" >> $GITHUB_ENV
run: |
echo 'GENERATED_NOTES<<EOF' >> $GITHUB_ENV
echo $(curl -X POST -H 'Accept: application/vnd.github.v3+json' -H 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/generate-notes -d '{"tag_name":"${{ env.TAG_NAME }}", "previous_tag_name":"${{ env.PREVIOUS_TAG_NAME }}"}' | jq -r .body | sed 's,",\\",g' | sed "s,',\\',g") >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Checkout code
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
Expand Down Expand Up @@ -238,4 +243,4 @@ jobs:
-H "Accept: application/vnd.github.v3+json" \
-H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }} \
-d '{"draft":true, "body":"${{ env.RELEASE_BODY }}\n${{ env.GENERATED_NOTES }}"}'
-d '{"draft":false, "body":"${{ env.RELEASE_BODY }}\n${{ env.GENERATED_NOTES }}"}'

0 comments on commit 6c47826

Please sign in to comment.