GithubHelp home page GithubHelp logo

youssefshaaban / githubactionsautomationsandbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from n8ebel/githubactionsautomationsandbox

0.0 1.0 0.0 201 KB

Example repo demonstrating different types of automated tasks and CI integrations using GitHub Actions and Danger

Kotlin 55.36% Shell 14.23% Ruby 30.41%

githubactionsautomationsandbox's Introduction

Nightly Build

Example repo demonstrating different types of automated tasks and CI integrations

Examples Included

  • 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

Triggering Repository_Dispatch Workflows

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

Triggering Workflow_Dispatch Events

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 the branch, tag, or commit 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

Resources

githubactionsautomationsandbox's People

Contributors

n8ebel avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.