Trigger Track Visitors and Generate Summaries #2
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
name: Trigger Track Visitors and Generate Summaries | |
on: | |
schedule: | |
- cron: '*/10 * * * *' # Runs every 10 minutes | |
workflow_dispatch: | |
inputs: | |
runs: | |
description: 'Runs' | |
type: number | |
default: 1 | |
required: false | |
jobs: | |
trigger: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up GitHub CLI | |
run: | | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 | |
sudo apt-add-repository https://cli.github.com/packages | |
sudo apt update | |
sudo apt install gh | |
- name: Authenticate GitHub CLI | |
run: gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}" | |
- name: Trigger Callee Workflow | |
env: | |
RUNS: ${{ inputs.runs }} | |
run: | | |
for (( i=0; i<RUNS; i++ )); do | |
gh workflow run --repo "$GITHUB_REPOSITORY" Track Visitors and Generate Summaries | |
sleep 600 # Sleep for 10 minutes | |
done |