Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Scheduled ktlint with Github Actions
# .github/workflows/daily-ktlint.yml
name: Android CI (Ktlint)
on:
schedule:
# Daily 7am (JST)
- cron: '00 22 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: ktlintFormat
continue-on-error: true
run: ./gradlew --no-daemon -Dorg.gradle.parallel=false -Dorg.gradle.configureondemand=false ktlintFormat
- name: Create Pull Request
uses: cats-oss/create-pull-request@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
PULL_REQUEST_BRANCH: daily-ktlint
COMMIT_MESSAGE: Auto-modify files by daily ktlint
PULL_REQUEST_TITLE: Changes from daily ktlint
PULL_REQUEST_BODY: This is an auto-generated PR with changes from daily ktlint
AUTHOR_EMAIL: ********@email.com
AUTHOR_NAME: your-name
@mejdi14

This comment has been minimized.

Copy link

@mejdi14 mejdi14 commented Sep 24, 2020

this is pretty cool, thanks for sharing!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment