-
Notifications
You must be signed in to change notification settings - Fork 0
Add prod/release branch triggers to workflows and auto-create branches #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,115 @@ | ||
| version https://git-lfs.github.com/spec/v1 | ||
| oid sha256:f20c21552d72da557bb7ebc34d9fe705628718aced7687a7aa5a6b45831588d0 | ||
| size 2624 | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, prod, release, copilot/** ] | ||
| pull_request: | ||
| branches: [ main, prod, release ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| verify: | ||
| name: Verify Repository | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Check file structure | ||
| run: | | ||
| echo "Checking required files..." | ||
| for file in .gitignore README.md Makefile package.json Dockerfile; do | ||
| if [ ! -f "$file" ]; then | ||
| echo "ERROR: Missing required file: $file" | ||
| exit 1 | ||
| fi | ||
| done | ||
| echo "✓ All required files present" | ||
|
|
||
| - name: Verify scripts | ||
| run: | | ||
| echo "Verifying scripts..." | ||
| if [ -d scripts ]; then | ||
| for script in scripts/*.sh; do | ||
| if [ -f "$script" ]; then | ||
| bash -n "$script" || exit 1 | ||
| echo "✓ $script syntax OK" | ||
| fi | ||
| done | ||
| fi | ||
| echo "✓ Script verification complete" | ||
|
|
||
| - name: Check for large files | ||
| run: | | ||
| echo "Checking for large files (>5MB)..." | ||
| large_files=$(find . -type f -size +5M -not -path "./.git/*" -not -path "./backups/*" -not -path "./node_modules/*") | ||
| if [ -n "$large_files" ]; then | ||
| echo "WARNING: Large files found:" | ||
| echo "$large_files" | ||
| else | ||
| echo "✓ No large files found" | ||
| fi | ||
|
|
||
| test: | ||
| name: Test Package | ||
| runs-on: ubuntu-latest | ||
| needs: verify | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install | ||
|
|
||
| - name: Run tests | ||
| run: npm test | ||
|
|
||
| - name: Validate package | ||
| run: npm pack --dry-run | ||
|
|
||
| markdown-lint: | ||
| name: Markdown Lint | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Lint markdown files | ||
| uses: DavidAnson/markdownlint-cli2-action@v16 | ||
| with: | ||
| globs: | | ||
| **/*.md | ||
| !node_modules | ||
|
|
||
| makefile-test: | ||
| name: Test Makefile | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Test Makefile commands | ||
| run: | | ||
| make help | ||
| make info | ||
| make stats | ||
| make install | ||
| make test | ||
| make validate | ||
| echo "✓ All Makefile commands executed successfully" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: Create Branches | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| create-branches: | ||
| name: Create prod and release branches | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Create prod branch | ||
| run: | | ||
| if ! git ls-remote --exit-code --heads origin prod; then | ||
| git checkout -b prod | ||
| git push origin prod | ||
| echo "✓ Created prod branch" | ||
|
Comment on lines
+22
to
+27
|
||
| else | ||
| echo "prod branch already exists" | ||
| fi | ||
|
|
||
| - name: Create release branch | ||
| run: | | ||
| git checkout ${{ github.sha }} | ||
| if ! git ls-remote --exit-code --heads origin release; then | ||
| git checkout -b release | ||
| git push origin release | ||
| echo "✓ Created release branch" | ||
| else | ||
| echo "release branch already exists" | ||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description says workflows are being updated to trigger on
main,prod, andrelease, butci.ymlalso addscopilot/**to the push branch filters. If this is intentional, please update the PR description; otherwise remove the extra branch pattern to match the stated scope.