Files
InfiniteAPI/.github/workflows/test.yml
T
Claude 16699781c7 fix(ci): add GITHUB_TOKEN authentication for git operations
Yarn 4 converts HTTPS URLs to SSH internally. Added token-based
authentication using GITHUB_TOKEN to allow accessing public GitHub
repositories without SSH keys.

https://claude.ai/code/session_01QPt4WssG6jjEciQKdVpFtK
2026-02-02 17:47:08 +00:00

51 lines
1.4 KiB
YAML

name: Run Tests
on:
push:
branches:
- master
pull_request:
jobs:
run-tests:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js and Corepack
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Enable Corepack and Set Yarn Version
run: |
corepack enable
corepack prepare yarn@4.x --activate
- name: Configure Git for HTTPS
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Force git to use HTTPS instead of SSH for GitHub repositories
git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"
git config --global url."https://github.com/".insteadOf "git@github.com:"
# Configure git to use GITHUB_TOKEN for authentication
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
- name: Restore Yarn Cache
uses: actions/cache@v3
id: yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --immutable
- name: Run tests
run: yarn test