Skip to content

feat: replace curl/GITLAB_TOKEN with glab CLI in init script #153

feat: replace curl/GITLAB_TOKEN with glab CLI in init script

feat: replace curl/GITLAB_TOKEN with glab CLI in init script #153

Workflow file for this run

name: CI
on:
push:
pull_request:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@a15d269cd4658e1107c09f1fabf4cbd7bd1f308a # v4.4.0
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Check
run: pnpm run check
- name: Build
run: pnpm run build
templatesyncignore_check:
if: github.event.repository.is_template == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Check .templatesyncignore completeness
run: |
set -f # disable globbing to safely expand $WHITELIST
# Extract whitelisted files from .templatesyncignore
WHITELIST=$(grep -E '^\s*:!' .templatesyncignore | sed 's/^\s*:!//')
# Check that all whitelisted files are tracked in git
MISSING=""
for f in $WHITELIST; do
if ! git ls-files --error-unmatch "$f" >/dev/null 2>&1; then
MISSING="$MISSING $f"
fi
done
if [ -n "$MISSING" ]; then
echo "::error::The following files are in .templatesyncignore but not tracked in git:"
echo "$MISSING" | tr ' ' '\n' | grep -v '^$'
echo ""
echo "Either add them to the repo or remove from .templatesyncignore"
exit 1
fi
# Reverse check: find tracked files not in whitelist (informational)
git ls-files | sort > /tmp/tracked.txt
echo "$WHITELIST" | tr ' ' '\n' | grep -v '^$' | sort > /tmp/whitelist.txt
NOT_LISTED=$(comm -23 /tmp/tracked.txt /tmp/whitelist.txt)
if [ -n "$NOT_LISTED" ]; then
echo "::notice::Tracked files not in whitelist (user-owned, not synced):"
echo "$NOT_LISTED"
fi
echo "Whitelist check passed."