mirror of
https://github.com/AstrBotDevs/AstrBot.git
synced 2026-11-29 10:07:30 +08:00
Bumps the github-actions group with 2 updates: [github/codeql-action](https://github.com/github/codeql-action) and [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv). Updates `github/codeql-action` from 4.39.3 to 4.39.4 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v4.39.3...v4.39.4) Updates `astral-sh/setup-uv` from 10.3.3 to 10.4.0 - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/v10.3.3...v10.4.0) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.39.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: astral-sh/setup-uv dependency-version: 10.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
73 lines
2.8 KiB
YAML
73 lines
2.8 KiB
YAML
name: Sync GitHub Project
|
|
|
|
on:
|
|
issues:
|
|
types: [opened, reopened, closed, labeled, unlabeled, edited]
|
|
pull_request_target:
|
|
types: [opened, reopened, closed, edited, synchronize, ready_for_review, converted_to_draft]
|
|
schedule:
|
|
- cron: '17 */6 * * *'
|
|
workflow_dispatch:
|
|
inputs:
|
|
apply:
|
|
description: 'Apply the change plan (false previews without writing)'
|
|
type: boolean
|
|
default: false
|
|
required: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
# Every run reconciles the whole project; serialize snapshots, not just items.
|
|
# Pending runs can be replaced; full scans recover items closed since project creation.
|
|
concurrency:
|
|
group: project-sync-${{ github.repository }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
sync:
|
|
if: >-
|
|
github.repository == 'AstrBotDevs/AstrBot' &&
|
|
vars.ASTRBOT_PROJECT_ID != '' &&
|
|
(github.event_name != 'pull_request_target' ||
|
|
github.event.pull_request.head.repo.full_name == github.repository)
|
|
# Configure this environment to allow only the default branch before adding secrets.
|
|
environment: project-sync
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Validate manual branch
|
|
if: github.event_name == 'workflow_dispatch' && github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
|
|
run: |
|
|
echo 'Manual sync must run from the default branch.'
|
|
exit 1
|
|
# Never check out the PR head or a PR-controlled base branch with this token.
|
|
- name: Check out trusted default branch
|
|
uses: actions/checkout@v7
|
|
with:
|
|
ref: ${{ github.event.repository.default_branch || github.ref_name }}
|
|
persist-credentials: false
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
sparse-checkout: scripts/sync_github_project.py
|
|
sparse-checkout-cone-mode: false
|
|
|
|
- name: Set up uv
|
|
uses: astral-sh/setup-uv@v10.4.0
|
|
|
|
- name: Synchronize current item state
|
|
env:
|
|
ASTRBOT_PROJECT_ID: ${{ vars.ASTRBOT_PROJECT_ID }}
|
|
ASTRBOT_PROJECT_STATUS_OPEN: ${{ vars.ASTRBOT_PROJECT_STATUS_OPEN }}
|
|
ASTRBOT_PROJECT_STATUS_DONE: ${{ vars.ASTRBOT_PROJECT_STATUS_DONE }}
|
|
ASTRBOT_PROJECT_STATUS_MAP: ${{ vars.ASTRBOT_PROJECT_STATUS_MAP }}
|
|
ASTRBOT_PROJECT_TOKEN: ${{ secrets.ASTRBOT_PROJECT_ENV_TOKEN }}
|
|
ASTRBOT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch || github.ref_name }}
|
|
APPLY_CHANGES: ${{ github.event_name != 'workflow_dispatch' || inputs.apply }}
|
|
run: |
|
|
if [ "$APPLY_CHANGES" = 'true' ]; then
|
|
uv run --no-project python -I scripts/sync_github_project.py --apply
|
|
else
|
|
uv run --no-project python -I scripts/sync_github_project.py
|
|
fi
|