mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Feature/new discord action (#489)
* Updating docker action * adding version to message * adding way to get PR title and body * Adding input pass to workflows Workflow dispatches may not get push header info. Switching logic to pass needed title and body info through just in case. * adding token The description on this action is awful, it didn't mention needing a token. I found this solution from the repo's issues * parsing pr body * Updating parsing * Updating docker workflow * Reverting back to default variables * fixing syntax error * removing heading syntax * updating parse * Updating parsing * Updating docker workflow * trying to remove newline * updating parsing * Replacement in parsing * Update sonar-scan.yml * testing passing pr body via artifact * Updating syntax
This commit is contained in:
parent
21fa4330d4
commit
e14f8ded2d
0
.github/pr.txt
vendored
Normal file
0
.github/pr.txt
vendored
Normal file
32
.github/workflows/nightly-docker.yml
vendored
32
.github/workflows/nightly-docker.yml
vendored
@ -7,10 +7,7 @@ on:
|
|||||||
description: "PR Title"
|
description: "PR Title"
|
||||||
required: true
|
required: true
|
||||||
default: ""
|
default: ""
|
||||||
body:
|
|
||||||
description: "PR Body"
|
|
||||||
required: true
|
|
||||||
default: ""
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
name: Building Nightly Docker
|
name: Building Nightly Docker
|
||||||
@ -22,6 +19,29 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: develop
|
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
|
- name: NodeJS to Compile WebUI
|
||||||
uses: actions/setup-node@v2.1.5
|
uses: actions/setup-node@v2.1.5
|
||||||
with:
|
with:
|
||||||
@ -90,7 +110,7 @@ jobs:
|
|||||||
uses: rjstone/discord-webhook-notify@v1
|
uses: rjstone/discord-webhook-notify@v1
|
||||||
with:
|
with:
|
||||||
severity: info
|
severity: info
|
||||||
description: v${{steps.get-version.outputs.assembly-version}}
|
description: v${{steps.get-version.outputs.assembly-version}} - ${{ github.event.inputs.title }}
|
||||||
details: '${{ github.event.inputs.body }}'
|
details: '${{ steps.parse-body.outputs.BODY }}'
|
||||||
text: A new nightly build has been released for docker.
|
text: A new nightly build has been released for docker.
|
||||||
webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}
|
webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}
|
||||||
|
22
.github/workflows/sonar-scan.yml
vendored
22
.github/workflows/sonar-scan.yml
vendored
@ -133,23 +133,27 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Parse PR body
|
- name: Write PR body
|
||||||
run: |
|
uses: DamianReeves/write-file-action@latest
|
||||||
|
with:
|
||||||
|
path: ${{ env.home }}/.github/pr.txt
|
||||||
|
contents: |
|
||||||
body='${{ steps.findPr.outputs.body }}'
|
body='${{ steps.findPr.outputs.body }}'
|
||||||
echo $body
|
echo $body
|
||||||
body="${body//'%'/'%25'}"
|
write-mode: overwrite
|
||||||
body="${body//$'\n'/'%0A'}"
|
|
||||||
body="${body//$'\r'/'%0D'}"
|
- name: Upload PR Body as Artifact
|
||||||
echo $body
|
uses: actions/upload-artifact@v2
|
||||||
echo "::set-output name=BODY::$body"
|
with:
|
||||||
id: parse-body
|
name: prbody
|
||||||
|
path: .github/pr.txt
|
||||||
|
|
||||||
- name: If Push to Develop, Trigger Docker Stable
|
- name: If Push to Develop, Trigger Docker Stable
|
||||||
uses: benc-uk/workflow-dispatch@v1
|
uses: benc-uk/workflow-dispatch@v1
|
||||||
with:
|
with:
|
||||||
workflow: Build Nightly Docker
|
workflow: Build Nightly Docker
|
||||||
token: ${{ secrets.REPO_GHA_PAT }}
|
token: ${{ secrets.REPO_GHA_PAT }}
|
||||||
inputs: '{ "title": "${{ steps.findPr.outputs.title }}", "body": "${{ steps.parse-body.outputs.BODY }}" }'
|
inputs: '{ "title": "${{ steps.findPr.outputs.title }}" }'
|
||||||
|
|
||||||
stable:
|
stable:
|
||||||
name: Trigger Stable Docker if Main push
|
name: Trigger Stable Docker if Main push
|
||||||
|
Loading…
x
Reference in New Issue
Block a user