From 8835a4119b74812c24b4cd9cd21b1e113b81500e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Apr 2026 08:37:16 +0000 Subject: [PATCH] [github-graph]: Synced files from `git-config`. --- .github/workflows/export-rulesets.yml | 61 ++------------------------- .github/workflows/import-rulesets.yml | 58 ++----------------------- 2 files changed, 6 insertions(+), 113 deletions(-) diff --git a/.github/workflows/export-rulesets.yml b/.github/workflows/export-rulesets.yml index fb8faf0..da0b945 100644 --- a/.github/workflows/export-rulesets.yml +++ b/.github/workflows/export-rulesets.yml @@ -1,63 +1,8 @@ -# ================================================================================================= -# Exports rules from GitHub's internal configuration into '.github/rulesets'. -# Only triggered manually, which should be done following every manual configuration change. -# ================================================================================================= - name: Export Rulesets - on: workflow_dispatch: - workflow_call: - -# Cancel in-progress runs when starting a new one. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true jobs: - run: - runs-on: ubuntu-latest - env: - REPO_DIR: repo - RULESETS_DIR: repo/.github/rulesets - - permissions: - contents: write - pull-requests: write - - steps: - - name: Check requirements - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - run: | - if [ -z "$GH_TOKEN" ]; then - echo "::error::GH_TOKEN secret is not set." \ - "Create a GitHub Personal Access Token with sufficient access" \ - "and add it as a repository secret named GH_TOKEN." - exit 1 - fi - - - name: Checkout - uses: actions/checkout@v4 - with: - path: repo - - - name: Checkout github-rules - uses: actions/checkout@v4 - with: - repository: SgtSwagrid/github-rules - path: github-rules - - - name: Sync - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - run: bash github-rules/scripts/export-rulesets.sh - - - name: Publish - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - BASE_BRANCH: ${{ github.ref_name }} - UPDATE_BRANCH: ci/export-rulesets - PR_TITLE: "[ci] Exported GitHub rulesets to source." - PR_BODY_FILE: github-rules/templates/pull-request-body.md - run: bash github-rules/scripts/publish.sh + export: + uses: SgtSwagrid/github-rules/.github/workflows/export-rulesets.yml@main + secrets: inherit diff --git a/.github/workflows/import-rulesets.yml b/.github/workflows/import-rulesets.yml index fe33684..ff025ce 100644 --- a/.github/workflows/import-rulesets.yml +++ b/.github/workflows/import-rulesets.yml @@ -1,63 +1,11 @@ -# ================================================================================================= -# Imports rules from '.github/rulesets' into GitHub's internal configuration. -# Triggered by modifications to this directory on the default branch, or manually. -# ================================================================================================= - name: Import Rulesets - on: push: paths: - .github/rulesets/** workflow_dispatch: - workflow_call: - -# Cancel in-progress runs when starting a new one. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true jobs: - run: - runs-on: ubuntu-latest - # Only respond to changes on the default branch. - if: > - github.event_name == 'workflow_dispatch' || - github.event_name == 'workflow_call' || - github.ref_name == github.event.repository.default_branch - env: - REPO_DIR: repo - RULESETS_DIR: repo/.github/rulesets - - steps: - - name: Check requirements - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - run: | - if [ -z "$GH_TOKEN" ]; then - echo "::error::GH_TOKEN secret is not set." \ - "Create a GitHub Personal Access Token with sufficient access" \ - "and add it as a repository secret named GH_TOKEN." - exit 1 - fi - - - name: Checkout - uses: actions/checkout@v4 - with: - path: repo - - - name: Checkout github-rules - uses: actions/checkout@v4 - with: - repository: SgtSwagrid/github-rules - path: github-rules - - - name: Clear - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - run: bash github-rules/scripts/clear-rulesets.sh - - - name: Sync - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - run: bash github-rules/scripts/import-rulesets.sh + import: + uses: SgtSwagrid/github-rules/.github/workflows/import-rulesets.yml@main + secrets: inherit