Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

Feature/new discord action (#489)

Robbie Davise14f8ded2d98
diff --git a/.github/pr.txt b/.github/pr.txt
new file mode 100644
index 000000000..e69de29bb
diff --git a/.github/workflows/nightly-docker.yml b/.github/workflows/nightly-docker.yml
index 9f57c8974..6205ca1cc 100644
--- a/.github/workflows/nightly-docker.yml
+++ b/.github/workflows/nightly-docker.yml
@@ -7,10 +7,7 @@ on:
description: "PR Title"
required: true
default: ""
- body:
- description: "PR Body"
- required: true
- default: ""
+
jobs:
docker:
name: Building Nightly Docker
@@ -22,6 +19,29 @@ jobs:
with:
ref: develop
+ - name: Download PR Body
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ github_token: ${{secrets.GITHUB_TOKEN}}
+ workflow: sonar-scan.yml
+ path: .github/
+
+ - name: Get PR body
+ uses: pCYSl5EDgo/cat@master
+ id: prbody
+ with:
+ path: .github/pr.txt
+
+ - name: Parse PR body
+ run: |
+ body='${{ steps.findPr.outputs.body }}'
+ body="${body//'%'/'%25'}"
+ body="${body//$'\n'/'%0A'}"
+ body="${body//$'\r'/'%0D'}"
+ echo $body
+ echo "::set-output name=BODY::$body"
+ id: parse-body
+
- name: NodeJS to Compile WebUI
uses: actions/[email protected]
with:
@@ -90,7 +110,7 @@ jobs:
uses: rjstone/discord-webhook-notify@v1
with:
severity: info
- description: v${{steps.get-version.outputs.assembly-version}}
- details: '${{ github.event.inputs.body }}'
+ description: v${{steps.get-version.outputs.assembly-version}} - ${{ github.event.inputs.title }}
+ details: '${{ steps.parse-body.outputs.BODY }}'
text: A new nightly build has been released for docker.
webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}
diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml
index 51e0f6370..0da7a6f22 100644
--- a/.github/workflows/sonar-scan.yml
+++ b/.github/workflows/sonar-scan.yml
@@ -133,23 +133,27 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- - name: Parse PR body
- run: |
- body='${{ steps.findPr.outputs.body }}'
- echo $body
- body="${body//'%'/'%25'}"
- body="${body//$'\n'/'%0A'}"
- body="${body//$'\r'/'%0D'}"
- echo $body
- echo "::set-output name=BODY::$body"
- id: parse-body
+ - name: Write PR body
+ uses: DamianReeves/write-file-action@latest
+ with:
+ path: ${{ env.home }}/.github/pr.txt
+ contents: |
+ body='${{ steps.findPr.outputs.body }}'
+ echo $body
+ write-mode: overwrite
+
+ - name: Upload PR Body as Artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: prbody
+ path: .github/pr.txt
- name: If Push to Develop, Trigger Docker Stable
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Build Nightly Docker
token: ${{ secrets.REPO_GHA_PAT }}
- inputs: '{ "title": "${{ steps.findPr.outputs.title }}", "body": "${{ steps.parse-body.outputs.BODY }}" }'
+ inputs: '{ "title": "${{ steps.findPr.outputs.title }}" }'
stable:
name: Trigger Stable Docker if Main push
@@ -162,4 +166,4 @@ jobs:
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Build Stable Docker
- token: ${{ secrets.REPO_GHA_PAT }}
\ No newline at end of file
+ token: ${{ secrets.REPO_GHA_PAT }}