Skip to content

Instantly share code, notes, and snippets.

@wasabeef
Created September 3, 2019 07:18
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wasabeef/60113a9d4dec64ad71a901c089aae8b5 to your computer and use it in GitHub Desktop.
Save wasabeef/60113a9d4dec64ad71a901c089aae8b5 to your computer and use it in GitHub Desktop.
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
Copy link

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