-
-
Notifications
You must be signed in to change notification settings - Fork 96
34 lines (30 loc) · 1.07 KB
/
diff.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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```'
});