Skip to content

Commit

Permalink
Tries to get the URL of the HTML report file
Browse files Browse the repository at this point in the history
  • Loading branch information
Tweener committed Aug 7, 2023
1 parent f3b4d47 commit 72d5b54
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 45 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/checkVersionDependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ jobs:
- name: Check for new versions of dependencies
run: ./gradlew dependencyUpdates -DoutputFormatter=html -DoutputDir=build/dependencyUpdates -DreportfileName=report

- name: Adds the content of the list of dependencies to the environment variable
id: get-dependencies-list
run: |
file_output=$(<build/dependencyUpdates/report.txt)
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "DEPENDENCIES_LIST_FILE<<$EOF" >> $GITHUB_OUTPUT
echo "$file_output" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- name: Print the content of the environment variable
run: echo "${{ steps.get-dependencies-list.outputs.DEPENDENCIES_LIST_FILE }}"
# - name: Adds the content of the list of dependencies to the environment variable
# id: get-dependencies-list
# run: |
# file_output=$(<build/dependencyUpdates/report.html)
# EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
# echo "DEPENDENCIES_LIST_FILE<<$EOF" >> $GITHUB_OUTPUT
# echo "$file_output" >> $GITHUB_OUTPUT
# echo "$EOF" >> $GITHUB_OUTPUT
#
# - name: Print the content of the environment variable
# run: echo "${{ steps.get-dependencies-list.outputs.DEPENDENCIES_LIST_FILE }}"

- name: Send notification on Slack
uses: rtCamp/[email protected]
Expand All @@ -45,7 +45,7 @@ jobs:
SLACK_CHANNEL: ${{ vars.SLACK_GITHUB_ACTIONS_CHANNEL_NAME }}
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: ${{ vars.SLACK_GITHUB_ACTIONS_DEPENDENCY_UPDATES_ICON_URL }}
SLACK_MESSAGE: ${{ steps.get-dependencies-list.outputs.DEPENDENCIES_LIST_FILE }}
SLACK_MESSAGE: "Report URL: ${{ github.server_url }}/${{ github.repository }}/build/dependencyUpdates/report.html"
SLACK_TITLE: Dependencies with outdated versions
SLACK_USERNAME: Dependency Updates
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
33 changes: 0 additions & 33 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import java.io.StringWriter

plugins {
//trick: for the same plugin versions in all sub-modules
Expand All @@ -20,38 +19,6 @@ tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
candidate.version.isNonStable()
}

outputFormatter {
// Outdated dependencies
val outdated = this.outdated.dependencies
if (outdated.isNotEmpty()) {
val writer = java.io.StringWriter()
writer.appendLine("The following dependencies have later milestone versions:")
outdated.forEach { dependency ->
writer.appendLine(" - ${dependency.group}:${dependency.name} [${dependency.version} -> ${dependency.available.milestone}]")
writer.appendLine(" ${dependency.projectUrl}")
}
println(writer.toString())
}

// Unresolved dependencies (failed to determine the latest version)
val unresolved = this.unresolved.dependencies
if (unresolved.isNotEmpty()) {
val writer = java.io.StringWriter()
writer.appendLine("Failed to determine the latest version for the following dependencies:")
unresolved.forEach { dependency ->
writer.appendLine(" - ${dependency.group}:${dependency.name} -> ${dependency.version}")
}
println(writer.toString())
}

// Gradle
val gradle = this.gradle
val writer = java.io.StringWriter()
writer.appendLine("Gradle release-candidate updates:")
writer.appendLine(" - Gradle: [${gradle.running.version} -> ${gradle.current.version} -> ${gradle.releaseCandidate.version}]")
println(writer.toString())
}
}

fun String.isNonStable(): Boolean {
Expand Down

0 comments on commit 72d5b54

Please sign in to comment.