Skip to content

Commit

Permalink
Merge pull request #50 from KaushikMalapati/daff
Browse files Browse the repository at this point in the history
Daff
  • Loading branch information
KaushikMalapati authored Dec 12, 2024
2 parents 59b60f3 + a73c134 commit 00c039f
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/daff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Comment Diff

on:
pull_request_target:
paths:
- 'Spreadsheet/**'

jobs:
comment-diff:
runs-on: ubuntu-20.04
defaults:
run:
# The following allows for each run step to utilize ~/.bash_profile
# for setting up the per-step initial state.
# --login: a login shell. Source ~/.bash_profile
# -e: exit on first error
# -o pipefail: piped processes are important; fail if they fail
shell: bash --login -eo pipefail {0}
permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}

- name: install requirements
run: |
pip install --upgrade pip
pip install daff
- name: make diff
run: |
daff git csv
git config set --global diff.daff-csv.command "daff diff --git --output-format html --fragment --context 0"
git remote add target https://github.com/pcdshub/pcds-nalms.git
git fetch target
git diff target/${{ github.event.pull_request.base.ref }}...HEAD Spreadsheet/ > ${{ runner.temp }}/diff.txt
- name: make comment
uses: thollander/actions-comment-pull-request@v3
with:
file-path: ${{ runner.temp }}/diff.txt
comment-tag: csvdiff

0 comments on commit 00c039f

Please sign in to comment.