Slack User Count #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a workflow to extract the user count from slack | |
name: Slack User Count | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on on schedule for the main branch | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '0 0 * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# 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 main branch under $GITHUB_WORKSPACE, so job can access it | |
- uses: actions/checkout@v2 | |
with: | |
ref: main | |
token: ${{ secrets.ACCESS_TOKEN }} | |
submodules: 'recursive' | |
# Install dotenv python package to load tokens in script | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
# pip3 install python-dotenv | |
# Runs a script using the runners shell | |
- name: Run a user extraction script | |
working-directory: ./metrics/slack | |
env: | |
CORTX: ${{ secrets.CORTX }} | |
CORTX_COOKIE: ${{ secrets.CORTX_COOKIE }} | |
MINIO: ${{ secrets.MINIO }} | |
MINIO_COOKIE: ${{ secrets.MINIO_COOKIE }} | |
CEPH: ${{ secrets.CEPH }} | |
CEPH_COOKIE: ${{ secrets.CEPH_COOKIE }} | |
OPENIO: ${{ secrets.OPENIO }} | |
OPENIO_COOKIE: ${{ secrets.OPENIO_COOKIE }} | |
DAOS: ${{ secrets.DAOS }} | |
DAOS_COOKIE: ${{ secrets.DAOS_COOKIE }} | |
OPENSTACK: ${{ secrets.OPENSTACK }} | |
OPENSTACK_COOKIE: ${{ secrets.OPENSTACK_COOKIE }} | |
SLACK_OAUTH: ${{ secrets.SLACK_OAUTH }} | |
run: | | |
python3 slack_user_count.py | |
# Commmit the slack pickle file local repo | |
- name: Commit files | |
run: | | |
git config --global user.email "cortx.application@seagate.com" | |
git config --global user.name "cortx-admin" | |
git add ./metrics/pickles/slack_users_stats.pickle | |
git commit -m "Updating the slack user count on `date +'%Y-%m-%d %H:%M:%S'`" | |
git push origin main |