Skip to content

Synchronize users #15643

Synchronize users

Synchronize users #15643

# Two roles:
# 1. Runs often to avoid Supabase to enter sleep-mode (https://supabase.com/docs/going-into-prod#availability)
# 2. Synchronize the player-table in the database with the memberships on TIHLDE.org
#
# An auth token from tihlde.org MUST be set as a secret in TIHLDE_AUTH_TOKEN
# Since the is needed at the /api/refresh-players endpoint
name: Synchronize users
on:
schedule:
- cron: 0 * * * *
workflow_dispatch:
jobs:
synchronize:
name: Synchronize users
runs-on: ubuntu-latest
strategy:
matrix:
url: ['https://pythons.tihlde.org', 'https://pythons-damer.tihlde.org']
steps:
- name: Synchronize users
id: request
uses: fjogeleit/http-request-action@v1
with:
url: '${{ matrix.url }}/api/refresh-players'
method: 'POST'
timeout: 20000
data: '{"authToken": "${{ secrets.TIHLDE_AUTH_TOKEN }}"}'
- name: Respons
run: |
echo ${{ steps.request.outputs.response }}