hyerim-kim / slack-status

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slack Status

SetStatus Language grade: JavaScript License: MIT

Change User's status on Slack workspace using puppeteer.

Setup

Prep work

You need to save 3 envs in the repository secrets. Be sure to save those as the following.

  • TARGET_URL=https://workspace.slack.example
  • USER_EMAIL=sung@sungyub.com
  • USER_PASSWORD=pass

Setting Repository Workflow

name: SetStatus

on:
  workflow_dispatch:
  schedule:
    - cron: '0 16 * * *' # runs every day at 1 am. on KST

jobs:
  set-status:
    name: Set User's status at slack
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [ 14.x ]
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
          cache: 'npm'
      - run: npm ci
      - run: npm test
        env:
          TARGET_URL: ${{secrets.TARGET_URL}}
          USER_EMAIL: ${{secrets.USER_EMAIL}}
          USER_PASSWORD: ${{secrets.USER_PASSWORD}}

Work

  1. Go to TARGET_URL
  2. Logging, USER_EMAIL and using USER_PASSWORD
  3. If user status exists, remove it.
  4. Set custom user status. Custom User Status like this:

License

These source code files are made available under th MIT License, located in the LICENSE file.

About

License:MIT License


Languages

Language:JavaScript 100.0%