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: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: cachix/install-nix-action@v31 with: extra_nix_config: | experimental-features = nix-command flakes - name: worktree base for diff run: git worktree add "$RUNNER_TEMP/base" "${{ github.event.pull_request.base.sha }}" - name: build closures and render diff run: | nix run .#ci -- diff "$RUNNER_TEMP/base" . \ "### System closure diff vs \`${{ github.event.pull_request.base.ref }}\`" \ > "$RUNNER_TEMP/comment.md" nix run .#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 .#ci -- post-comment "" "$RUNNER_TEMP/comment.md"