> ## Documentation Index
> Fetch the complete documentation index at: https://calendar-effects.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# scripts/install_workflows.sh

> Put the cloud streamer's workflow and page into the team's private live-stream repository on github.com (decision 0015): hosting/workflows/live-stream.yml -> Calendar-Effects/live-stream/.github/workflows/ hosting/live-stream/README.md -> Calendar-Effects/live-stream/README.md Run it again after cha

`scripts/install_workflows.sh` · chapter [Tests and team tooling](https://calendar-effects.mintlify.site/tour/10-tests-and-tooling.md), file 28 · 29 lines · [open in the repository](https://github.sfu.ca/aba395/Calendar-Effects/blob/main/scripts/install_workflows.sh)

## What it does

Put the cloud streamer's workflow and page into the team's private live-stream repository on
github.com (decision 0015):
hosting/workflows/live-stream.yml -> Calendar-Effects/live-stream/.github/workflows/
hosting/live-stream/README.md     -> Calendar-Effects/live-stream/README.md
Run it again after changing either. It signs in with the GitHub CLI (gh auth login, with the
workflow scope: gh auth refresh -h github.com -s workflow), and pushes only what changed. The code
the workflow runs is a separate copy on the repository's `project` branch (scripts/sync\_live\_stream.sh).

## Source

```bash title="scripts/install_workflows.sh" lines expandable theme={null}
#!/usr/bin/env bash
# Put the cloud streamer's workflow and page into the team's private live-stream repository on
# github.com (decision 0015):
#   hosting/workflows/live-stream.yml -> Calendar-Effects/live-stream/.github/workflows/
#   hosting/live-stream/README.md     -> Calendar-Effects/live-stream/README.md
# Run it again after changing either. It signs in with the GitHub CLI (gh auth login, with the
# workflow scope: gh auth refresh -h github.com -s workflow), and pushes only what changed. The code
# the workflow runs is a separate copy on the repository's `project` branch (scripts/sync_live_stream.sh).
set -euo pipefail
root=$(git rev-parse --show-toplevel)
org=$(cd "$root/src" && python3 -c "from common.settings import GITHUB_ORG; print(GITHUB_ORG)")
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT

g() { git -c credential.helper= -c 'credential.helper=!gh auth git-credential' "$@"; }

dir="$work/live-stream"
g clone -q --branch main "https://github.com/$org/live-stream.git" "$dir"
mkdir -p "$dir/.github/workflows"
cp "$root/hosting/workflows/live-stream.yml" "$dir/.github/workflows/live-stream.yml"
cp "$root/hosting/live-stream/README.md" "$dir/README.md"
git -C "$dir" add -A
if git -C "$dir" diff --cached --quiet; then
  echo "live-stream: already up to date."
  exit 0
fi
git -C "$dir" commit -q -m "Workflow and page from $(git -C "$root" rev-parse --short HEAD)"
g -C "$dir" push -q origin HEAD:main
echo "live-stream: pushed the workflow and page."
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.