Add gradle-args
to publish-kotlin
workflow
#1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-changelog-renovate | ||
on: | ||
workflow_call: | ||
inputs: | ||
restore-kotlin-native-cache: | ||
description: 'Restore Kotlin cache, `~/.konan` directory' | ||
default: true | ||
required: false | ||
type: boolean | ||
gradle-args: | ||
description: `Gradle args for Add updated dependencies step` | ||
gradle-cache: | ||
description: 'Use Gradle cache' | ||
default: '' | ||
required: false | ||
type: string | ||
gradle-cache-cleanup: | ||
description: 'Enable removing unnecessary Gradle home cache' | ||
default: true | ||
required: false | ||
type: string | ||
secrets: | ||
TOKEN_GITHUB_ACTION: | ||
required: true | ||
jobs: | ||
add-updated-dependencies-to-changelog: | ||
if: github.actor == 'renovate[bot]' | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3.5.2 | ||
with: | ||
fetch-depth: 0 | ||
token: '${{ secrets.TOKEN_GITHUB_ACTION }}' | ||
- name: Restore Kotlin native cache | ||
if: ${{ inputs.restore-kotlin-native-cache == 'true' }} | ||
uses: actions/cache@v3.3.1 | ||
with: | ||
path: ~/.konan | ||
key: ${{ runner.os }}-konan-${{ hashFiles('**/gradle/libs.versions.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-konan- | ||
- name: Set up Java | ||
uses: actions/setup-java@v3.11.0 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2.4.2 | ||
with: | ||
cache-disabled: ${{ inputs.gradle-cache == 'false' }} | ||
gradle-home-cache-cleanup: ${{ inputs.gradle-cache-cleanup == 'true' }} | ||
- name: Add updated dependencies to the CHANGELOG from Renovate | ||
run: ./gradlew addChangelogItem --renovateCommitTable ${{ inputs.gradle-args }} | ||
- name: Commit and push | ||
run: | | ||
git config --global user.email "action@github.com" | ||
git config --global user.name "GitHub Action" | ||
git diff | ||
git add . | ||
git commit --amend --no-edit | ||
git push --force |