/
githubmirror
/
ceph
Обзор
Документация
Войти
/
githubmirror
/
ceph
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
.github/workflows/diff-ceph-config.yml
107 строк
4 KB
Patrick Donnelly
.github/workflows: bump checkout action version
27 июл 2026, 16:36
Не верифицирован
27 июл 2026, 16:36
841baf9
Код
Авторство
О чём код?
--- name: Check Ceph config changes on: pull_request_target: types: - opened - synchronize - edited - reopened permissions: issues: write contents: read pull-requests: write jobs: pull_request: env: PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} PR_NUMBER: ${{ github.event.pull_request.number }} PR_COMMITS: ${{ github.event.pull_request.commits }} BASE_REPO_URL: ${{ github.event.pull_request.base.repo.clone_url }} BASE_REF: ${{ github.event.pull_request.base.ref }} HEAD_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }} if: github.repository == 'ceph/ceph' runs-on: ubuntu-latest steps: - name: Checkout main branch for pull_request_target uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: 'refs/heads/main' path: ceph sparse-checkout: | src/script src/common/options .github/workflows - name: Get common ancestor between PR and Ceph upstream main branch id: get_common_ancestor working-directory: ceph env: BRANCH_PR: origin/${{ github.event.pull_request.head.ref }} run: | set -euo pipefail FETCH_DEPTH=$(( PR_COMMITS + 1 )) REFSPEC="+${PR_HEAD_SHA}:remotes/origin/pr/${PR_NUMBER}/head" git fetch origin "$REFSPEC" \ --depth="$FETCH_DEPTH" \ --no-tags \ --prune \ --no-recurse-submodules COMMON_ANCESTOR_SHA=$(git rev-list \ --first-parent \ --max-parents=0 \ --max-count=1 \ "origin/pr/${PR_NUMBER}/head") echo "COMMON_ANCESTOR_SHA=$COMMON_ANCESTOR_SHA" >> "$GITHUB_ENV" - name: Setup Python uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: '3.13' - name: Install python packages working-directory: ceph run: | pip3 install -r ./src/script/config-diff/requirements.txt - name: Execute config diff tool id: diff_tool working-directory: ceph env: REF_REPO: ${{ github.event.pull_request.base.repo.clone_url }} REF_BRANCH: ${{ github.event.pull_request.base.ref }} REF_COMMIT_SHA: ${{ env.COMMON_ANCESTOR_SHA }} REMOTE_REPO: ${{ github.event.pull_request.head.repo.clone_url }} REMOTE_BRANCH: ${{ github.event.pull_request.head.ref }} REMOTE_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} run: | set -euo pipefail { echo 'DIFF_JSON<<EOF' python3 ./src/script/config-diff/config_diff.py \ diff-branch-remote-repo \ --ref-branch "$REF_BRANCH" \ --ref-commit-sha "$REF_COMMIT_SHA" \ --remote-repo "$REMOTE_REPO" \ --cmp-branch "$REMOTE_BRANCH" \ --cmp-commit-sha "$REMOTE_COMMIT_SHA" \ --format=posix-diff \ --skip-clone echo EOF } >> "$GITHUB_OUTPUT" - name: Post output as a comment uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DIFF_JSON_OUTPUT: ${{ steps.diff_tool.outputs.DIFF_JSON }} with: script: | const configDiff = process.env.DIFF_JSON_OUTPUT; const postComment = require('./ceph/.github/workflows/scripts/config-diff-post-comment.js'); postComment({ github, context, core, configDiff });