Git Product home page Git Product logo

slack-circleci-approval-template's Introduction

Environment variable setup

Environment variables are required for Network request.

CircleCI token - https://app.circleci.com/settings/user/tokens
Slack Incoming hook url - https://api.slack.com/messaging/webhooks#posting_with_webhooks

SLACK_HOOK_URL=
CIRCLECI_TOKEN=
APPROVAL_JOB_NAME=

Feature

Support approve job and cancel workflow in slack

Tracking user who performed actions

How to use this template

  1. Slack) Create your slack app that supports incoming webhooks and interactive components
  2. Slack) Get Slack incoming webhook url
  3. CircleCI) Get CircleCI personal token
  4. YourApp) Add Environment variable that SLACK_HOOK_URL, CIRCLECI_TOKEN and serve your app
  5. CircleCI) Add Environment variable that SLACK_ACTION_URL from step 4
  6. Slack) Add url to interactivty request url from step 4
  7. CircleCI) Add send-slack-message job
      send-slack-message:
        working_directory: ~/project
        docker:
          - image: circleci/node:latest
        steps:
          - checkout
          - run:
              name: "Setup environment variable"
              command: echo export APP_VERSION=$(node -e "console.log(require('./package.json').version)") >> $BASH_ENV
          - run:
              name: "Request message"
              command: |
                curl -d version=$APP_VERSION \
                  -d workflowId=$CIRCLE_WORKFLOW_ID \
                  -d branch=$CIRCLE_BRANCH \
                  $SLACK_ACTION_URL/circleci/react-native \
  8. YourApp) Add Environment variable that APPROVAL_JOB_NAME
  9. CircleCI) Add approval job same with APPROVAL_JOB_NAME

slack-circleci-approval-template's People

Contributors

bang9 avatar imgbotapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

slack-circleci-approval-template's Issues

How to use this in a project

Hello, this looks exactly like what I am looking for but I don't understand how you would pull this into an existing project with Circle CI. Can you explain how I would go about doing that? Thanks!

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.