-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yaml
32 lines (31 loc) · 996 Bytes
/
action.yaml
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
name: 'Git Diff - Powered by Rust'
description: 'Action to get the files that have been changed in a pull request'
branding:
icon: 'git-pull-request'
color: 'purple'
inputs:
patterns:
description: 'Patterns to search for'
required: true
outputs:
DIFF_FILES:
description: 'List of files that have been changed'
value: ${{ steps.get-git-diff.outputs.DIFF_FILES }}
DIFF_COUNT:
description: 'Number of files that have been changed'
value: ${{ steps.get-git-diff.outputs.DIFF_COUNT }}
runs:
using: 'composite'
steps:
- name: Get Binary
shell: bash
run: |
BIN_URL=$(curl https://api.github.com/repos/LuisLiraC/git-diff/releases/tags/v1.0.3 | jq -r '.assets[0].browser_download_url')
curl -s -L $BIN_URL -o rust-binary.tgz
tar -xzvf rust-binary.tgz
mv ./Linux/git-diff ./git-diff
- name: Run git-diff
id: get-git-diff
shell: bash
run: |
./git-diff --patterns='${{ inputs.patterns }}'