Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bang9/slack-circleci-approval-template
CircleCI approval integration with slack interaction
https://github.com/bang9/slack-circleci-approval-template
approve-job circleci circleci-slack slack slack-button slack-interactions slack-interactive-actions
Last synced: 21 days ago
JSON representation
CircleCI approval integration with slack interaction
- Host: GitHub
- URL: https://github.com/bang9/slack-circleci-approval-template
- Owner: bang9
- Created: 2021-08-27T20:02:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-28T16:35:50.000Z (over 3 years ago)
- Last Synced: 2024-12-24T12:40:05.272Z (about 1 month ago)
- Topics: approve-job, circleci, circleci-slack, slack, slack-button, slack-interactions, slack-interactive-actions
- Language: TypeScript
- Homepage: https://velog.io/@bang9dev/react-native-deploy-via-slack-2
- Size: 279 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 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```dotenv
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
```yaml
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`