Skip to content

Commit

Permalink
Link to full diff in git comments (#4593)
Browse files Browse the repository at this point in the history
* Link to full diff in git comments

* Show full diff of new and deleted files
  • Loading branch information
scholtzan authored Nov 21, 2023
1 parent fe2bf1d commit 150db27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -598,16 +598,19 @@ jobs:
- run:
name: Generate diff
command: |
diff -bur --no-dereference \
diff -bur --no-dereference --new-file \
/tmp/workspace/main-generated-sql/dags/ /tmp/workspace/generated-sql/dags/ \
> /tmp/workspace/generated-sql/sql.diff || true
diff -bur --no-dereference \
diff -bur --no-dereference --new-file \
/tmp/workspace/main-generated-sql/sql/ /tmp/workspace/generated-sql/sql/ \
>> /tmp/workspace/generated-sql/sql.diff || true
- persist_to_workspace:
root: /tmp/workspace
paths:
- generated-sql
- store_artifacts:
path: /tmp/workspace/generated-sql/sql.diff
destination: sql.diff
post-diff:
docker:
- image: circleci/node:8.10.0
Expand All @@ -617,9 +620,6 @@ jobs:
at: /tmp/workspace
- run: npm i circle-github-bot
- run: .circleci/post-diff.js
- store_artifacts:
path: /tmp/integration
destination: /app/integration
reset-stage-env:
docker: *docker
steps:
Expand Down
2 changes: 2 additions & 0 deletions .circleci/post-diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ ${warnings}
bot.comment(process.env.GH_AUTH_TOKEN, `
### Integration report for "${bot.env.commitMessage}"
${diff()}
[Link to full diff](https://output.circle-artifacts.com/output/job/${process.env.CIRCLE_WORKFLOW_JOB_ID}/artifacts/${process.env.CIRCLE_NODE_INDEX}/sql.diff)
`);

0 comments on commit 150db27

Please sign in to comment.