Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add diff generating workflow to help PR reviews #603

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Print the diff between the official and the generated file
name: Diff
on:
pull_request:
branches: [ main ]

permissions:
contents: read

jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Generate Diff
id: diff
run: |
bash dockerhub_doc_config_update.sh
diff=$(git --no-pager diff -U0 --ignore-matching-lines='^GitCommit:' --no-index official-eclipse-temurin eclipse-temurin)
echo "diff=$diff" >> "$GITHUB_OUTPUT"

- name: Print diff as a comment
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ steps.diff.outputs.diff != '' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '```diff\n' + ${{ steps.diff.outputs.diff }} + '\n```'
});
Loading