Github Workflow to change Smart Bulb color to RED on Pull Request 
Tags: actionshackathon, github, opensource
Published: 2020-09-18 06:19:25

---
title: Github Workflow to change Smart Bulb color to RED on Pull Request 
published: true
description: This Github Workflow changes Smart Bulb color to RED on Pull Request (and Green on Merge - This part is WIP) 
tags: actionshackathon, github, opensource
---

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon, please fill out all sections.)


### Change lightings on a Pull request in Github (or a Push request)
We all get very busy while focusing on fixing that bug or building a new feature but what if something as urgent as a code push or a pull request comes your way. 

![Red Bulb](https://cdn.shopify.com/s/files/1/0219/0638/products/LIFX_-BR30-E2627-2-Lit_9a266300-7c81-4fad-a041-4ee5a527bce2_720x.jpg?v=1591769233)

This workflow which talks to your IOT devices in this specific implementation LIFX Smart bulbs, does notify certain actions on Github by changing bulb color. 

This Github Workflow changes Smart Bulb color to RED on Pull Request (and Green on Merge - This part is WIP) 

Future integration in progreas:
1. Changing Yellow color for the bulb on merge conflict event 
2. Applause or cheers sent via Alexa as a speaker (Alexa push voice capability)
3. Brew coffee using the IOT smart plugs (TP link/Wyze etc)

This was the most basic implementation we could do in whatever time we could get for this hackathon. (The entire team spent close to 4-5 hours only to bring it in this state)


### Submission Category: 

DIY Deployments, Interesting IoT, Phone Friendly, Wacky Wildcards

### Yaml File and Link to Code

#### Link to Code
Please feel free to check it, fork it and ask me anything, here is the repo:
{% github https://github.com/gh-hack-2020/super-secret-app %}

#### Yaml File
```yaml
# Workflow to help you get started with Actions

name: CI

# Control when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch (push/pull)
on:
  push:
    branches:  master
  pull:
    branches:  master
  
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      # Runs a single command using the runners shell
      - name: Run a one-line script
        run: echo Running Github Workflow for Push/Pull!

      # Runs a set of commands using the runners shell
      - name: Run a multi-line script
        run: |
          echo Add other actions to build,
          echo test, and deploy your project.
          
      - name: Hit curl
        uses: wei/curl@master
        with:
          args:  http://54.161.236.73:8888/github/event?repoId=rep1
          
          
      
```

https://github.com/gh-hack-2020/super-secret-app/blob/master/.github/workflows/iotAction.yml


### Additional Resources / Info
Collaborators: 
[Vasu Jain (Product, Architect, Dev)](https://dev.to/vj)
[Pranav Saxena (Lead Developer)](https://dev.to/psaxena130)