Files
server-config/.github/workflows/diff-pr.yml
Floweynt bc6d66432a
diff-pr / dix (pull_request) Successful in 6m24s
flake-check / flake-check (pull_request) Successful in 52s
lint / lint (pull_request) Successful in 1m48s
fix again
2026-09-13 12:32:55 -05:00

49 lines
1.5 KiB
YAML

name: diff-pr
on:
pull_request:
permissions:
contents: read
pull-requests: write
concurrency:
group: diff-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
dix:
runs-on: nix
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: merge base branch
run: |
git config user.email "ci@localhost"
git config user.name "CI"
git fetch origin ${{ github.event.pull_request.base.ref }}
git merge --no-edit origin/${{ github.event.pull_request.base.ref }}
- name: worktree base for diff
run: git worktree add "$RUNNER_TEMP/base" "origin/${{ github.event.pull_request.base.ref }}"
- name: build closures and render diff
run: |
nix run -L .#ci -- diff "$RUNNER_TEMP/base" . \
"### System closure diff vs \`${{ github.event.pull_request.base.ref }}\`" \
> "$RUNNER_TEMP/comment.md"
nix run -L .#ci -- inspect-diff "$RUNNER_TEMP/base" . \
"### Inspection diff vs \`${{ github.event.pull_request.base.ref }}\`" \
>> "$RUNNER_TEMP/comment.md"
- name: post/update PR comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API: ${{ github.api_url }}
REPO: ${{ github.repository }}
PR: ${{ github.event.pull_request.number }}
run: nix run -L .#ci -- post-comment "<!-- dix-diff -->" "$RUNNER_TEMP/comment.md"