1
0
mirror of https://github.com/actions/checkout.git synced 2026-03-10 09:01:44 +08:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Dev-Re2906
1d9492ec58
Merge 4abe0c8600 into 8edcb1bdb4 2025-07-24 06:44:11 +00:00
Dev-Re2906
4abe0c8600
Merge branch 'actions:main' into Dev-Re2906 2025-07-24 10:14:08 +03:30
Dev-Re2906
a782b8de45
Create dependabot-automerge.yml
Signed-off-by: Dev-Re2906 <jalilirad2906@gmail.com>
2025-07-24 10:14:01 +03:30
Dev-Re2906
9acba16622
Create min.yml
Signed-off-by: Dev-Re2906 <jalilirad2906@gmail.com>
2025-07-24 10:13:11 +03:30
Dev-Re2906
61c760622c
Update dependabot.yml
Signed-off-by: Dev-Re2906 <jalilirad2906@gmail.com>
2025-07-24 10:10:46 +03:30
Tingluo Huang
8edcb1bdb4
Update CODEOWNERS for actions (#2224) 2025-07-23 09:20:20 -04:00
4 changed files with 271 additions and 19 deletions

104
.github/dependabot.yml vendored
View File

@ -1,20 +1,88 @@
---
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
groups:
minor-npm-dependencies:
# NPM: Only group minor and patch updates (we want to carefully review major updates)
update-types: [minor, patch]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
minor-actions-dependencies:
# GitHub Actions: Only group minor and patch updates (we want to carefully review major updates)
update-types: [minor, patch]
# Node.js (npm, yarn, pnpm)
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
commit-message:
prefix: "deps"
include: "scope"
labels: ["dependencies", "automerge"]
reviewers: ["your-github-username"]
assignees: ["your-github-username"]
# Python (pip)
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
labels: ["dependencies", "python"]
# Rust (cargo)
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
labels: ["dependencies", "rust"]
# Go modules
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
labels: ["dependencies", "go"]
# Docker
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
labels: ["dependencies", "docker"]
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels: ["ci", "dependencies"]
# PHP (Composer)
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
labels: ["dependencies", "php"]
# Ruby (Bundler)
- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "daily"
labels: ["dependencies", "ruby"]
# Java (Maven)
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
labels: ["dependencies", "java"]
# .NET (NuGet)
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "daily"
labels: ["dependencies", "dotnet"]
# Security-focused updates
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
allow:
- dependency-type: "direct"
labels: ["security", "automerge"]
commit-message:
prefix: "security"

View File

@ -0,0 +1,46 @@
name: Dependabot Auto-merge
on:
pull_request:
types:
- opened
- synchronize
- reopened
permissions:
contents: write
pull-requests: write
jobs:
test-and-merge:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# نصب Node.js برای اجرای تست (اگر پروژه Node.js باشد)
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
# نصب وابستگی‌ها (در صورت وجود)
- run: |
if [ -f package.json ]; then
npm ci || true
npm run build --if-present || true
npm test || true
fi
# اجرای تست برای زبان‌های دیگر (به شکل ساده)
- run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt && pytest || true; fi
if [ -f Cargo.toml ]; then cargo test || true; fi
if [ -f go.mod ]; then go test ./... || true; fi
# در صورت موفقیت تست‌ها، Merge خودکار
- name: Merge PR
uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
merge-method: squash

138
.github/workflows/min.yml vendored Normal file
View File

@ -0,0 +1,138 @@
name: Self-Hosted Universal CI/CD
on:
push:
branches: [main, master]
tags: ['v*.*.*']
pull_request:
branches: [main, master]
types: [opened, synchronize, reopened, closed]
workflow_dispatch:
jobs:
detect-project:
name: Detect Project Language
runs-on: self-hosted
outputs:
lang: ${{ steps.detect.outputs.lang }}
steps:
- uses: actions/checkout@v4
- id: detect
run: |
if [ -f package.json ]; then
echo "lang=node" >> $GITHUB_OUTPUT
elif [ -f requirements.txt ]; then
echo "lang=python" >> $GITHUB_OUTPUT
elif [ -f Cargo.toml ]; then
echo "lang=rust" >> $GITHUB_OUTPUT
elif [ -f go.mod ]; then
echo "lang=go" >> $GITHUB_OUTPUT
elif ls *.csproj 1> /dev/null 2>&1; then
echo "lang=dotnet" >> $GITHUB_OUTPUT
elif [ -f pom.xml ]; then
echo "lang=java" >> $GITHUB_OUTPUT
elif [ -f composer.json ]; then
echo "lang=php" >> $GITHUB_OUTPUT
elif [ -f Gemfile ]; then
echo "lang=ruby" >> $GITHUB_OUTPUT
else
echo "lang=unknown" >> $GITHUB_OUTPUT
fi
build-test:
name: Build & Test (${{ needs.detect-project.outputs.lang }})
needs: detect-project
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
# Node.js
- name: Setup Node.js
if: ${{ needs.detect-project.outputs.lang == 'node' }}
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
# Python
- name: Setup Python
if: ${{ needs.detect-project.outputs.lang == 'python' }}
uses: actions/setup-python@v5
with:
python-version: 3.x
# Rust
- name: Setup Rust
if: ${{ needs.detect-project.outputs.lang == 'rust' }}
uses: actions-rs/toolchain@v1
with:
toolchain: stable
# Go
- name: Setup Go
if: ${{ needs.detect-project.outputs.lang == 'go' }}
uses: actions/setup-go@v5
with:
go-version: 1.21
# .NET
- name: Setup .NET
if: ${{ needs.detect-project.outputs.lang == 'dotnet' }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
# Java
- name: Setup Java
if: ${{ needs.detect-project.outputs.lang == 'java' }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
# PHP
- name: Setup PHP
if: ${{ needs.detect-project.outputs.lang == 'php' }}
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, xml, curl
tools: composer
# Ruby
- name: Setup Ruby
if: ${{ needs.detect-project.outputs.lang == 'ruby' }}
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
# Build
- name: Install & Build
run: |
case "${{ needs.detect-project.outputs.lang }}" in
node) npm ci && npm run build --if-present ;;
python) pip install -r requirements.txt ;;
rust) cargo build --release ;;
go) go build ./... ;;
dotnet) dotnet restore && dotnet build --configuration Release ;;
java) mvn install -DskipTests ;;
php) composer install --no-interaction ;;
ruby) bundle install ;;
*) echo "Unknown language - skipping build" ;;
esac
# Test
- name: Run Tests
run: |
case "${{ needs.detect-project.outputs.lang }}" in
node) npm test || true ;;
python) pytest || true ;;
rust) cargo test || true ;;
go) go test ./... || true ;;
dotnet) dotnet test --no-build --verbosity normal || true ;;
java) mvn test || true ;;
php) vendor/bin/phpunit || true ;;
ruby) bundle exec rspec || true ;;
*) echo "No tests configured" ;;
esac

View File

@ -1 +1 @@
* @actions/actions-launch
* @actions/actions-runtime