mirror of
https://github.com/hanzoai/cross-env.git
synced 2026-09-24 16:58:15 +00:00
Delete upstream workflows
This fork does not ship upstream's releases, and its hosted-runner jobs never start here. Claude-Session: https://claude.ai/code/session_01HuMDfgFssPUptYUzgZ6Cp8
This commit is contained in:
@@ -1,133 +0,0 @@
|
||||
name: π§ Auto Format
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
format:
|
||||
name: π§ Auto Format
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: π₯ Checkout code
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
ref: ${{ github.head_ref || github.ref_name }}
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: lts/*
|
||||
cache: 'npm'
|
||||
|
||||
- name: Cache node_modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Check current formatting
|
||||
id: format-check
|
||||
run: |
|
||||
if npm run format:check; then
|
||||
echo "format_needed=false" >> $GITHUB_OUTPUT
|
||||
echo "β
Code is already properly formatted"
|
||||
else
|
||||
echo "format_needed=true" >> $GITHUB_OUTPUT
|
||||
echo "β οΈ Code formatting issues found"
|
||||
fi
|
||||
|
||||
- name: Format code
|
||||
if: steps.format-check.outputs.format_needed == 'true'
|
||||
run: npm run format
|
||||
|
||||
- name: Check for changes
|
||||
id: changes
|
||||
if: steps.format-check.outputs.format_needed == 'true'
|
||||
run: |
|
||||
if git diff --quiet; then
|
||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||
echo "βΉοΈ No formatting changes to commit"
|
||||
else
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
echo "π Formatting changes detected"
|
||||
fi
|
||||
|
||||
# CI cannot commit to workflow files, so we need to check for non-workflow changes
|
||||
- name: Check for non-workflow changes
|
||||
id: non-workflow-changes
|
||||
if: steps.changes.outputs.has_changes == 'true'
|
||||
run: |
|
||||
git add -A
|
||||
git reset .github/workflows/
|
||||
if git diff --cached --quiet; then
|
||||
echo "has_non_workflow_changes=false" >> $GITHUB_OUTPUT
|
||||
echo "βΉοΈ Only workflow files have formatting changes - skipping commit"
|
||||
else
|
||||
echo "has_non_workflow_changes=true" >> $GITHUB_OUTPUT
|
||||
echo "π Non-workflow formatting changes detected"
|
||||
fi
|
||||
|
||||
- name: Configure Git
|
||||
if:
|
||||
steps.non-workflow-changes.outputs.has_non_workflow_changes == 'true'
|
||||
run: |
|
||||
git config --local user.email "[email protected]"
|
||||
git config --local user.name "GitHub Action"
|
||||
|
||||
- name: Commit and push changes
|
||||
if:
|
||||
steps.non-workflow-changes.outputs.has_non_workflow_changes == 'true'
|
||||
env:
|
||||
TARGET_REF: ${{ github.head_ref || github.ref_name }}
|
||||
run: |
|
||||
git commit -m "chore: π§ Auto-format code with Prettier [skip ci]
|
||||
|
||||
This commit was automatically generated by the auto-format workflow.
|
||||
Changes include:
|
||||
- Code formatting fixes
|
||||
- Consistent indentation
|
||||
- Proper line endings"
|
||||
git push origin HEAD:"$TARGET_REF"
|
||||
|
||||
- name: Comment on PR
|
||||
if:
|
||||
steps.non-workflow-changes.outputs.has_non_workflow_changes == 'true'
|
||||
&& github.event_name == 'pull_request'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: 'π§ **Auto-formatting applied!**\n\nI\'ve automatically formatted the code using Prettier and pushed the changes. The formatting is now consistent with the project standards.'
|
||||
})
|
||||
|
||||
- name: Success message
|
||||
if:
|
||||
steps.changes.outputs.has_changes == 'false' ||
|
||||
steps.format-check.outputs.format_needed == 'false' ||
|
||||
steps.non-workflow-changes.outputs.has_non_workflow_changes == 'false'
|
||||
run: |
|
||||
if [ "${{ steps.changes.outputs.has_changes }}" == "true" ] && [ "${{ steps.non-workflow-changes.outputs.has_non_workflow_changes }}" == "false" ]; then
|
||||
echo "β
Only workflow files had formatting changes - no commit needed!"
|
||||
else
|
||||
echo "β
No formatting changes needed - code is already properly formatted!"
|
||||
fi
|
||||
@@ -1,135 +0,0 @@
|
||||
name: π Validate
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: π¨ Build and Validate
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [lts/-1, lts/*, latest]
|
||||
|
||||
steps:
|
||||
- name: π₯ Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: π’ Setup Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'npm'
|
||||
|
||||
- name: π¦ Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: π¨ Build
|
||||
run: npm run build
|
||||
|
||||
- name: πΎ Cache build output
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
dist/
|
||||
key: build-${{ matrix.node-version }}-${{ github.sha }}
|
||||
|
||||
- name: π Type check
|
||||
run: npm run typecheck
|
||||
|
||||
- name: π§Ή Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: π§ͺ Test
|
||||
run: npm run test:coverage
|
||||
|
||||
- name: π Upload coverage
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
fail_ci_if_error: false
|
||||
|
||||
e2e:
|
||||
name: π E2E Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
node-version: [lts/*]
|
||||
|
||||
steps:
|
||||
- name: π₯ Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: π’ Setup Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'npm'
|
||||
|
||||
- name: π¦ Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: π¨ Build
|
||||
run: npm run build
|
||||
|
||||
# ensure we don't implicitly rely on dev dependencies
|
||||
- name: π¦ Prune dependencies
|
||||
run: npm prune --omit=dev
|
||||
|
||||
- name: π§ͺ Run cross-env e2e tests
|
||||
run: node e2e/test-cross-env.js
|
||||
|
||||
- name: π Run cross-env-shell e2e tests
|
||||
run: node e2e/test-cross-env-shell.js
|
||||
|
||||
- name: π§ Run default value syntax e2e tests
|
||||
run: node e2e/test-default-values.js
|
||||
|
||||
release:
|
||||
name: π Release
|
||||
needs: [build, e2e]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write # to be able to publish a GitHub release
|
||||
id-token: write # to enable use of OIDC for npm provenance
|
||||
issues: write # to be able to comment on released issues
|
||||
pull-requests: write # to be able to comment on released pull requests
|
||||
if:
|
||||
${{ github.repository == 'kentcdodds/cross-env' &&
|
||||
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
|
||||
github.ref) && github.event_name == 'push' }}
|
||||
steps:
|
||||
- name: β¬οΈ Checkout repo
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: π Restore build output
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
dist/
|
||||
key: build-lts/*-${{ github.sha }}
|
||||
fail-on-cache-miss: false
|
||||
|
||||
- name: π Release
|
||||
uses: cycjimmy/[email protected]
|
||||
with:
|
||||
semantic_version: 25
|
||||
branches: |
|
||||
[
|
||||
'+([0-9])?(.{+([0-9]),x}).x',
|
||||
'main',
|
||||
'next',
|
||||
'next-major',
|
||||
{name: 'beta', prerelease: true},
|
||||
{name: 'alpha', prerelease: true}
|
||||
]
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user