-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (38 loc) · 1 KB
/
sample-workflow.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
35
36
37
38
39
40
41
42
43
44
45
name: sample-workflow
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
sample:
runs-on: ubuntu-latest
steps:
# Need to checkout for testing the Action in this repo
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed to checkout all branches
# Start check the PR diff
- uses: ./
id: git-diff-action
with:
json_diff_file_output: diff.json
raw_diff_file_output: diff.txt
# Print the diff in JSON format
- name: print json diff
env:
DIFF: ${{ steps.git-diff-action.outputs.json-diff-path }}
run: cat $DIFF
# Echo the raw git diff
- name: print raw diff
env:
DIFF: ${{ steps.git-diff-action.outputs.raw-diff-path }}
run: cat $DIFF
# Upload the json diff as an artifact
- uses: actions/upload-artifact@v4
with:
name: json-diff
path: diff.json
retention-days: 1