Skip to content

Euler-Lagrange capabilities - Phase 1 #7204

Euler-Lagrange capabilities - Phase 1

Euler-Lagrange capabilities - Phase 1 #7204

Workflow file for this run

name: Lines of Code

Check warning on line 1 in .github/workflows/line-count.yml

View workflow run for this annotation

GitHub Actions / Lines of Code

Workflow execution policy warning (evaluate mode)

On November 2, 2026, GitHub will restrict `pull_request_target` on public repositories by default. To continue allowing the event trigger, configure an Actions policy. Learn more: https://gh.io/securely-using-pull_request_target#default-policy-for-pull_request_target
# pull_request_target: fork PRs are read-only under pull_request and cannot be
# commented on. Nothing in pr/ may ever be executed.
# Unfiltered by path: a PR that stops touching src/ must still run to clean up.
on:
pull_request_target:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true
jobs:
sz:
name: Core MFC Line Difference
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout the base branch
uses: actions/checkout@v5
with:
path: base
fetch-depth: 0
# git worktree, not actions/checkout: no untrusted checkout in a
# privileged workflow. Merge base, not branch tip: a stale branch is not
# charged for other people's lines.
- name: Get Line Diff
id: diff
working-directory: base
run: |
git fetch --no-tags origin "+refs/pull/${{ github.event.number }}/head:refs/mfc/pr"
git worktree add ../pr refs/mfc/pr
git worktree add ../mb "$(git merge-base HEAD refs/mfc/pr)"
./mfc.sh count_diff ../mb ../pr --markdown "$GITHUB_WORKSPACE/loc.md"
test -s "$GITHUB_WORKSPACE/loc.md" && echo "changed=true" >> "$GITHUB_OUTPUT" || echo "changed=false" >> "$GITHUB_OUTPUT"
- name: Comment Line Diff
if: steps.diff.outputs.changed == 'true'
uses: marocchino/sticky-pull-request-comment@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
skip_unchanged: true
recreate: true
path: loc.md
# No diff: take down any comment an earlier push left.
- name: Remove Line Diff Comment
if: steps.diff.outputs.changed == 'false'
uses: marocchino/sticky-pull-request-comment@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
delete: true