Example repo demonstrating different types of automated tasks and CI integrations
- Simple GitHub Actions workflow examples
- ktlint running in CI
- Gradle task to copy a pre-push git hook that validates ktlint
- .gitignore file which allows code styles, scopes, templates, etc to be tracked
- Pull Request template for GitHub
- Bug Report & Feature Issue templates for GitHub
- Danger integration to report APK size
- Danger integration to warn if WIP
- Danger integration to thank PR author
- Danger integration to add inline ktlint issue comments
- Danger integration to warn about missing PR description
- GitHub Actions workflow to check for dependency updates every day at 8:00
Running the following curl command will trigger 2 different workflows:
triggered_example.yml
triggerable_tasks.yml
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token <your-token-here>" \
--request POST \
--data '{"event_type": "do-something"}' \
https://api.github.com/repos/n8ebel/GitHubActionsAutomationSandbox/dispatches
With this command, the triggerable_tasks.yml
workflow will run, but several of the steps will not run because the repository_dispath event didn't have the required properties passed with it.
To run the full triggerable_tasks.yml
workflow, run the following curl command:
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token <your-token-here>" \
--request POST \
--data '{"event_type": "do-something", "client_payload": { "text": "a title"}}' \
https://api.github.com/repos/n8ebel/GitHubActionsAutomationSandbox/dispatches
Workflows configured to run in response to workflow_dispatch
events may be triggered in 2 ways:
- using the GitHub Actions api
- from the GitHub Actions UI in your repository
To trigger the workflow_dispatch_example.yml
workflow, the following curl can be used:
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token <your-token-here>" \
--request POST \
--data '{
"ref": "main",
"inputs":{
"input1":"some value",
"input2":"some value 2"
}
}' \
https://api.github.com/repos/n8ebel/GitHubActionsAutomationSandbox/actions/workflows/workflow_dispatch_example.yml/dispatches
- The
ref
input corresponds to thebranch
,tag
, orcommit
you want the workflow to be run on. - The
inputs
input corresponds with the inputs defined in the workflow file, and with what is present in the UI when triggering the workflow from GitHub
- GitHub Actions Marketplace
- GitHub Actions Documentation
- Git Hooks to Enforce Code Quality
- Creating a Pull Request Template for Your Repository
- Closing GitHub Issues With Keywords
- Danger Reference
- Getting Started With Danger
- Automating Code Review Tasks for Multi-Module Android Projects
- Gradle Play Publisher Plugin
- Firebase App Distribution
- Danger Checkstyle Format
- Gradle Versions Plugin