Skip to content

🎨 Modify api endpoint #149

🎨 Modify api endpoint

🎨 Modify api endpoint #149

Workflow file for this run

name: Validate PR
on:
pull_request:
types: [opened, synchronize, reopened]
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
permissions:
contents: read
jobs:
build-and-analyze:
runs-on: ubuntu-latest
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
- name: Cache SonarQube packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build and analyze
env:
SONAR_TOKEN: ${{ env.SONAR_TOKEN }}
run: chmod +x gradlew && ./gradlew build sonar --info
- name: Send Success Message
if: ${{ success() }}
uses: Ilshidur/[email protected]
with:
args: "We got a new pull request πŸ‘"
env:
DISCORD_WEBHOOK: ${{ env.DISCORD_WEBHOOK }}
DISCORD_EMBEDS: |
[
{
"author": {
"name": "${{ github.event.pull_request.user.login }}"
},
"title": "#${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}",
"color": 10478271,
"description": "[View on GitHub](${{ github.event.pull_request.html_url }})",
"fields": [
{
"name": "Base Branch",
"value": "${{ github.base_ref }}",
"inline": true
},
{
"name": "Compare Branch",
"value": "${{ github.head_ref }}",
"inline": true
}
]
}
]
- name: Send Failure Message
if: ${{ failure() }}
uses: Ilshidur/[email protected]
with:
args: "The pull request failed. Please resolve the issue and try again πŸ‘½"
env:
DISCORD_WEBHOOK: ${{ env.DISCORD_WEBHOOK }}
DISCORD_EMBEDS: |
[
{
"author": {
"name": "${{ github.event.pull_request.user.login }}"
},
"title": "#${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}",
"color": 13458524,
"description": "[View on GitHub](${{ github.event.pull_request.html_url }})",
"fields": [
{
"name": "Base Branch",
"value": "${{ github.base_ref }}",
"inline": true
},
{
"name": "Compare Branch",
"value": "${{ github.head_ref }}",
"inline": true
}
]
}
]