Compare commits
108 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c061ef1fa3 | ||
|
|
84fd7c7a42 | ||
|
|
af5a2e5d10 | ||
|
|
e8f8d088f6 | ||
|
|
c23398e584 | ||
|
|
9352b30cc3 | ||
|
|
7b1f7ad57b | ||
|
|
e368753cac | ||
|
|
b47ed0ffe6 | ||
|
|
0e1d04f780 | ||
|
|
814a7ea227 | ||
|
|
4420c3c441 | ||
|
|
feadcbc861 | ||
|
|
b60f5e56b6 | ||
|
|
489e2d514f | ||
|
|
d889202b3a | ||
|
|
9ec430d951 | ||
|
|
ca2815e08c | ||
|
|
120ceacaf7 | ||
|
|
d205273c8b | ||
|
|
cc55e77a98 | ||
|
|
64fdc4478a | ||
|
|
669bce6c25 | ||
|
|
8d5a33c603 | ||
|
|
00d83b13d6 | ||
|
|
223d074d69 | ||
|
|
d31b4186e9 | ||
|
|
223ef07a3f | ||
|
|
5eeb83fa4e | ||
|
|
83e0ed24b0 | ||
|
|
737590d30e | ||
|
|
4c551d94e0 | ||
|
|
506d6c005e | ||
|
|
fa5d79bbb3 | ||
|
|
c9e3c674ba | ||
|
|
fbfaba544e | ||
|
|
417b634812 | ||
|
|
69ce8f5302 | ||
|
|
abf3dc48a6 | ||
|
|
36864ca8c6 | ||
|
|
689cd8a7ea | ||
|
|
715ae3d38e | ||
|
|
a85fa79b00 | ||
|
|
bdade9e883 | ||
|
|
e18ccae8fe | ||
|
|
ffb6aef8bf | ||
|
|
fd4add0d40 | ||
|
|
049242589c | ||
|
|
33a185bbac | ||
|
|
122b223c04 | ||
|
|
78d6add10d | ||
|
|
ca86f77326 | ||
|
|
56c6262bb9 | ||
|
|
1c5a3415f3 | ||
|
|
48835883f9 | ||
|
|
8673629857 | ||
|
|
a4321716fa | ||
|
|
c29faf8e4f | ||
|
|
c2eb99504f | ||
|
|
21c1f27d33 | ||
|
|
6c66f86688 | ||
|
|
3a11f58d0f | ||
|
|
fc280adde0 | ||
|
|
66a53ea26f | ||
|
|
6868b512ca | ||
|
|
d3c7a0c249 | ||
|
|
3a74bab53c | ||
|
|
f41f9eb54b | ||
|
|
ea54bfb72a | ||
|
|
68680cd505 | ||
|
|
a66004fa3e | ||
|
|
869aee8642 | ||
|
|
cd917a1be7 | ||
|
|
f003c2bfa4 | ||
|
|
40de2adecb | ||
|
|
69750fb30a | ||
|
|
78af41436f | ||
|
|
12a63a5a84 | ||
|
|
d3cc0d7b88 | ||
|
|
3a416d7bb8 | ||
|
|
8a0c8897e3 | ||
|
|
09028ea846 | ||
|
|
2d4ff74f14 | ||
|
|
e1d275d6d3 | ||
|
|
d048f47c2d | ||
|
|
3e1a5a0bbb | ||
|
|
c9d7fbfa0b | ||
|
|
b3f247794c | ||
|
|
9977eb95fd | ||
|
|
b2955a59c4 | ||
|
|
5eaa2d80dd | ||
|
|
eacae5936a | ||
|
|
cf6221a4b5 | ||
|
|
fbedd6101a | ||
|
|
f4e014f855 | ||
|
|
d17d3f38e4 | ||
|
|
c9641bed95 | ||
|
|
6225b0e9ee | ||
|
|
50f3d5fc1b | ||
|
|
181cc0611b | ||
|
|
fa940d172e | ||
|
|
c19401a7a4 | ||
|
|
ad6929ba2c | ||
|
|
ed79e46837 | ||
|
|
6d50907015 | ||
|
|
15c871605e | ||
|
|
b13dd562b4 | ||
|
|
ee1e50f1df |
12
.github/FUNDING.yml
vendored
Normal file
12
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: jackton1
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: tj-actions
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
otechie: # Replace with a single Otechie username
|
||||||
|
custom: []
|
||||||
10
.github/ISSUE_TEMPLATE.md
vendored
10
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,10 +0,0 @@
|
|||||||
* changed-files:
|
|
||||||
|
|
||||||
### Description
|
|
||||||
|
|
||||||
Describe what you were trying to get done.
|
|
||||||
Tell us what happened, what went wrong, and what you expected to happen.
|
|
||||||
|
|
||||||
### What I Did
|
|
||||||
|
|
||||||
Add some details about your workflow ?
|
|
||||||
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: "[BUG]"
|
||||||
|
labels: bug
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Desktop (please complete the following information):**
|
||||||
|
- OS: [e.g. iOS]
|
||||||
|
- Browser [e.g. chrome, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
19
.github/workflows/auto-approve.yml
vendored
Normal file
19
.github/workflows/auto-approve.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Auto approve
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-approve:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: hmarr/auto-approve-action@v2
|
||||||
|
if: |
|
||||||
|
github.actor == 'dependabot[bot]' ||
|
||||||
|
github.actor == 'dependabot' ||
|
||||||
|
github.actor == 'dependabot-preview[bot]' ||
|
||||||
|
github.actor == 'dependabot-preview' ||
|
||||||
|
github.actor == 'renovate[bot]' ||
|
||||||
|
github.actor == 'renovate'
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.PAT_TOKEN }}
|
||||||
19
.github/workflows/label-conflict.yml
vendored
Normal file
19
.github/workflows/label-conflict.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: "Maintenance"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
types: [synchronize]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
main:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: check if prs are dirty
|
||||||
|
uses: eps1lon/actions-label-merge-conflict@releases/2.x
|
||||||
|
with:
|
||||||
|
dirtyLabel: "PR: needs rebase"
|
||||||
|
repoToken: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
commentOnDirty: "This pull request has conflicts, please resolve those before we can evaluate the pull request."
|
||||||
|
commentOnClean: "Conflicts have been resolved."
|
||||||
10
.github/workflows/sync-release-version.yml
vendored
10
.github/workflows/sync-release-version.yml
vendored
@@ -9,13 +9,19 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Sync release version
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Sync release version.
|
||||||
uses: tj-actions/sync-release-version@v8
|
uses: tj-actions/sync-release-version@v8
|
||||||
id: sync-release-version
|
id: sync-release-version
|
||||||
with:
|
with:
|
||||||
pattern: 'tj-actions/changed-files@'
|
pattern: '${{ github.repository }}@'
|
||||||
paths: |
|
paths: |
|
||||||
README.md
|
README.md
|
||||||
|
- name: Generate CHANGELOG
|
||||||
|
uses: tj-actions/github-changelog-generator@v1.3
|
||||||
|
with:
|
||||||
|
output: 'HISTORY.md'
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v3
|
uses: peter-evans/create-pull-request@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
11
.github/workflows/test.yml
vendored
11
.github/workflows/test.yml
vendored
@@ -15,12 +15,23 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
- name: Run changed-files with defaults
|
- name: Run changed-files with defaults
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: ./
|
uses: ./
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
echo "${{ toJSON(steps.changed-files.outputs) }}"
|
echo "${{ toJSON(steps.changed-files.outputs) }}"
|
||||||
|
- name: List all modified files
|
||||||
|
run: |
|
||||||
|
for file in "${{ steps.changed-files.outputs.modified_files }}"; do
|
||||||
|
echo $file
|
||||||
|
done
|
||||||
|
- name: Run step when README.md changes
|
||||||
|
if: contains(steps.changed-files.outputs.modified_files, 'README.md')
|
||||||
|
run: |
|
||||||
|
echo "Your README.md has been modified ${{ steps.changed-files.outputs.modified_files }}."
|
||||||
- name: Run changed-files with comma separator
|
- name: Run changed-files with comma separator
|
||||||
id: changed-files-comma
|
id: changed-files-comma
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
41
CHANGELOG.md
Normal file
41
CHANGELOG.md
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [v3](https://github.com/tj-actions/changed-files/tree/v3) (2021-04-02)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2.1...v3)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Update action.yml [\#11](https://github.com/tj-actions/changed-files/pull/11) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Update README.md [\#10](https://github.com/tj-actions/changed-files/pull/10) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Configure Renovate [\#9](https://github.com/tj-actions/changed-files/pull/9) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
|
- Update test.yml [\#8](https://github.com/tj-actions/changed-files/pull/8) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v2.1 [\#6](https://github.com/tj-actions/changed-files/pull/6) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v2.1](https://github.com/tj-actions/changed-files/tree/v2.1) (2021-03-18)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2...v2.1)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Upgraded to v2 [\#5](https://github.com/tj-actions/changed-files/pull/5) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v2](https://github.com/tj-actions/changed-files/tree/v2) (2021-03-14)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1...v2)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Fixed end of string with separator [\#4](https://github.com/tj-actions/changed-files/pull/4) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v1](https://github.com/tj-actions/changed-files/tree/v1) (2021-03-05)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/7eba13b12c69e63845b6d8bf1d3453edb0549ff9...v1)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Update action.yml [\#2](https://github.com/tj-actions/changed-files/pull/2) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
||||||
70
HISTORY.md
70
HISTORY.md
@@ -1,8 +1,68 @@
|
|||||||
History
|
# Changelog
|
||||||
-------
|
|
||||||
|
## [v3.3](https://github.com/tj-actions/changed-files/tree/v3.3) (2021-04-20)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v3.2...v3.3)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Update action.yml [\#18](https://github.com/tj-actions/changed-files/pull/18) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v3.2 [\#17](https://github.com/tj-actions/changed-files/pull/17) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v3.2](https://github.com/tj-actions/changed-files/tree/v3.2) (2021-04-11)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v3.1...v3.2)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Add support for all modified files [\#16](https://github.com/tj-actions/changed-files/pull/16) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Update test.yml [\#14](https://github.com/tj-actions/changed-files/pull/14) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v3.1 [\#13](https://github.com/tj-actions/changed-files/pull/13) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v3.1](https://github.com/tj-actions/changed-files/tree/v3.1) (2021-04-04)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v3...v3.1)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Upgraded to v3 [\#12](https://github.com/tj-actions/changed-files/pull/12) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v3](https://github.com/tj-actions/changed-files/tree/v3) (2021-04-02)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2.1...v3)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Update action.yml [\#11](https://github.com/tj-actions/changed-files/pull/11) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Update README.md [\#10](https://github.com/tj-actions/changed-files/pull/10) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Configure Renovate [\#9](https://github.com/tj-actions/changed-files/pull/9) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
|
- Update test.yml [\#8](https://github.com/tj-actions/changed-files/pull/8) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v2.1 [\#6](https://github.com/tj-actions/changed-files/pull/6) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v2.1](https://github.com/tj-actions/changed-files/tree/v2.1) (2021-03-18)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2...v2.1)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Upgraded to v2 [\#5](https://github.com/tj-actions/changed-files/pull/5) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v2](https://github.com/tj-actions/changed-files/tree/v2) (2021-03-14)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1...v2)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Fixed end of string with separator [\#4](https://github.com/tj-actions/changed-files/pull/4) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v1](https://github.com/tj-actions/changed-files/tree/v1) (2021-03-05)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/7eba13b12c69e63845b6d8bf1d3453edb0549ff9...v1)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Update action.yml [\#2](https://github.com/tj-actions/changed-files/pull/2) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
|
||||||
v1 (2021-03-04)
|
|
||||||
------------------
|
|
||||||
|
|
||||||
* Initial Release.
|
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
||||||
|
|||||||
149
README.md
149
README.md
@@ -1,14 +1,119 @@
|
|||||||
|
[](https://github.com/tj-actions/changed-files/actions/workflows/test.yml) [](https://github.com/tj-actions/changed-files/actions/workflows/sync-release-version.yml) <a href="https://github.com/search?q=tj-actions+changed-files+path%3A.github%2Fworkflows+language%3AYAML&type=code" target="_blank" title="Public workflows that use this action."><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fapi-git-master.endbug.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3Dtj-actions%2Fchanged-files%26badge%3Dtrue" alt="Public workflows that use this action."></a>
|
||||||
|
|
||||||
changed-files
|
changed-files
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
Get modified files
|
Get all modified files relative to the default branch.
|
||||||
|
|
||||||
|
> NOTE: :warning: This action should only run on the following events :warning:
|
||||||
|
> * [push](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push)
|
||||||
|
> * [pull_request](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request)
|
||||||
|
> * [pull_request_review](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_review)
|
||||||
|
> * [pull_request_review_comment](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_review_comment)
|
||||||
|
> * [pull_request_target](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target)
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Push event
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Test changed-files
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed_files
|
||||||
|
uses: tj-actions/changed-files@v3.3
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Pull Request events
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Test changed-files
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed_files
|
||||||
|
uses: tj-actions/changed-files@v3.3
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Get modified files
|
- name: Get changed files using defaults
|
||||||
uses: tj-actions/changed-files@v1
|
id: changed_files
|
||||||
|
uses: tj-actions/changed-files@v3.3
|
||||||
|
|
||||||
|
- name: Get changed files using a comma separator
|
||||||
|
id: changed_files_comma
|
||||||
|
uses: tj-actions/changed-files@v3.3
|
||||||
|
with:
|
||||||
|
separator: ","
|
||||||
|
|
||||||
|
- name: List all added files
|
||||||
|
run: |
|
||||||
|
for file in "${{ steps.changed_files.outputs.added_files }}"; do
|
||||||
|
echo $file
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Run step when a file changes in a PR relative to the default branch
|
||||||
|
if: contains(steps.changed_files.outputs.modified_files, 'my-file.txt')
|
||||||
|
run: |
|
||||||
|
echo "Your file my-file.txt has been modified."
|
||||||
|
|
||||||
|
- name: Run step when a file is deleted in a PR relative to the default branch
|
||||||
|
if: contains(steps.changed_files.outputs.deleted_files, 'test.txt')
|
||||||
|
run: |
|
||||||
|
echo "Your test.txt has been deleted."
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running [pre-commit](https://pre-commit.com/) on all modified files
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
...
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
|
||||||
|
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed_files
|
||||||
|
uses: tj-actions/changed-files@v3.3
|
||||||
|
|
||||||
|
- name: Pre-commit
|
||||||
|
uses: pre-commit/action@v2.0.0
|
||||||
|
with:
|
||||||
|
extra_args: -v --hook-stage push --files ${{ steps.changed_files.outputs.all_modified_files }}
|
||||||
|
token: ${{ secrets.github_token }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -16,16 +121,48 @@ Get modified files
|
|||||||
|
|
||||||
| Input | type | required | default | description |
|
| Input | type | required | default | description |
|
||||||
|:-------------:|:-----------:|:-------------:|:----------------------------:|:-------------:|
|
|:-------------:|:-----------:|:-------------:|:----------------------------:|:-------------:|
|
||||||
| separator | `string` | `true` | ` ` | Separator to return outputs |
|
| separator | `string` | `true` | `' '` | Separator to return outputs |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
Using the default separator.
|
||||||
|
|
||||||
|
| Output | type | example | description |
|
||||||
|
|:-------------------:|:------------:|:------------------------------:|:----------------------------------------:|
|
||||||
|
| added_files | `string` | 'new.txt other.png ...' | Select only files that are Added (A) |
|
||||||
|
| copied_files | `string` | 'new.txt other.png ...' | Select only files that are Copied (C) |
|
||||||
|
| deleted_files | `string` | 'new.txt other.png ...' | Select only files that are Deleted (D) |
|
||||||
|
| modified_files | `string` | 'new.txt other.png ...' | Select only files that are Modified (M) |
|
||||||
|
| renamed_files | `string` | 'new.txt other.png ...' | Select only files that are Renamed (R) |
|
||||||
|
| changed_files | `string` | 'new.txt other.png ...' | Select only files that have their type changed (T) |
|
||||||
|
| unmerged_files | `string` | 'new.txt other.png ...' | Select only files that are Unmerged (U) |
|
||||||
|
| unknown_files | `string` | 'new.txt other.png ...' | Select only files that are Unknown (X) |
|
||||||
|
| all_changed_files | `string` | 'new.txt other.png ...' | Select all paths (*) <br /> *i.e a combination of all options above.* |
|
||||||
|
| all_modified_files | `string` | 'new.txt other.png ...' | Select all modified files <br /> *i.e a combination of all added, <br />copied and modified files (ACM).* |
|
||||||
|
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Free software: [MIT license](LICENSE)
|
* Free software: [MIT license](LICENSE)
|
||||||
|
|
||||||
|
|
||||||
Features
|
Features
|
||||||
--------
|
--------
|
||||||
|
- Added Files
|
||||||
* TODO
|
- Copied Files
|
||||||
|
- Deleted Files
|
||||||
|
- Modified Files
|
||||||
|
- Renamed Files
|
||||||
|
- Changed Files
|
||||||
|
- Unmerged Files
|
||||||
|
- Unknown Files
|
||||||
|
- All Changed Files
|
||||||
|
|
||||||
|
|
||||||
Credits
|
Credits
|
||||||
|
|||||||
70
action.yml
70
action.yml
@@ -1,5 +1,5 @@
|
|||||||
name: Get modified files
|
name: Changed files
|
||||||
description: Get modified files
|
description: Get all changed files
|
||||||
author: tj-actions
|
author: tj-actions
|
||||||
inputs:
|
inputs:
|
||||||
separator:
|
separator:
|
||||||
@@ -10,62 +10,63 @@ inputs:
|
|||||||
outputs:
|
outputs:
|
||||||
added_files:
|
added_files:
|
||||||
description: List of added files.
|
description: List of added files.
|
||||||
value: ${{ steps.changed-files.outputs.added_files }}
|
value: ${{ steps.changed_files.outputs.added_files }}
|
||||||
copied_files:
|
copied_files:
|
||||||
description: List of copied files.
|
description: List of copied files.
|
||||||
value: ${{ steps.changed-files.outputs.copied_files }}
|
value: ${{ steps.changed_files.outputs.copied_files }}
|
||||||
deleted_files:
|
deleted_files:
|
||||||
description: List of deleted files.
|
description: List of deleted files.
|
||||||
value: ${{ steps.changed-files.outputs.deleted_files }}
|
value: ${{ steps.changed_files.outputs.deleted_files }}
|
||||||
modified_files:
|
modified_files:
|
||||||
description: List of modified files.
|
description: List of modified files.
|
||||||
value: ${{ steps.changed-files.outputs.modified_files }}
|
value: ${{ steps.changed_files.outputs.modified_files }}
|
||||||
renamed_files:
|
renamed_files:
|
||||||
description: List of renamed files.
|
description: List of renamed files.
|
||||||
value: ${{ steps.changed-files.outputs.renamed_files }}
|
value: ${{ steps.changed_files.outputs.renamed_files }}
|
||||||
changed_files:
|
changed_files:
|
||||||
description: List of changed files.
|
description: List of changed files.
|
||||||
value: ${{ steps.changed-files.outputs.changed_files }}
|
value: ${{ steps.changed_files.outputs.changed_files }}
|
||||||
unmerged_files:
|
unmerged_files:
|
||||||
description: List of unmerged files.
|
description: List of unmerged files.
|
||||||
value: ${{ steps.changed-files.outputs.unmerged_files }}
|
value: ${{ steps.changed_files.outputs.unmerged_files }}
|
||||||
unknown_files:
|
unknown_files:
|
||||||
description: List of unknown files.
|
description: List of unknown files.
|
||||||
value: ${{ steps.changed-files.outputs.unknown_files }}
|
value: ${{ steps.changed_files.outputs.unknown_files }}
|
||||||
all_changed_files:
|
all_changed_files:
|
||||||
description: List of all changed files.
|
description: List of all changed files.
|
||||||
value: ${{ steps.changed-files.outputs.all_changed_files }}
|
value: ${{ steps.changed_files.outputs.all_changed_files }}
|
||||||
|
all_modified_files:
|
||||||
|
description: List of all copied modified and added files
|
||||||
|
value: ${{ steps.changed_files.outputs.all_modified_files }}
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- id: changed-files
|
- id: changed_files
|
||||||
run: |
|
run: |
|
||||||
|
echo "Getting head sha..."
|
||||||
|
|
||||||
if [[ -z $GITHUB_BASE_REF ]]; then
|
if [[ -z $GITHUB_BASE_REF ]]; then
|
||||||
echo "Skipping: This should only run on pull_request.";
|
HEAD_SHA=$(git rev-parse HEAD^1 || true)
|
||||||
exit 0;
|
else
|
||||||
|
TARGET_BRANCH=${GITHUB_BASE_REF}
|
||||||
|
git fetch --depth=1 origin ${TARGET_BRANCH}:${TARGET_BRANCH}
|
||||||
|
HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TARGET_BRANCH=${GITHUB_BASE_REF}
|
|
||||||
CURRENT_BRANCH=${GITHUB_HEAD_REF}
|
|
||||||
|
|
||||||
git fetch --depth=1 origin ${TARGET_BRANCH}:${TARGET_BRANCH}
|
|
||||||
|
|
||||||
echo "Getting head sha..."
|
|
||||||
|
|
||||||
HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true)
|
|
||||||
|
|
||||||
ADDED=$(git diff --diff-filter=A --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" )
|
|
||||||
COPIED=$(git diff --diff-filter=C --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" )
|
|
||||||
DELETED=$(git diff --diff-filter=D --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" )
|
|
||||||
MODIFIED=$(git diff --diff-filter=M --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" )
|
|
||||||
RENAMED=$(git diff --diff-filter=R --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" )
|
|
||||||
CHANGED=$(git diff --diff-filter=T --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" )
|
|
||||||
UNMERGED=$(git diff --diff-filter=U --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" )
|
|
||||||
UNKNOWN=$(git diff --diff-filter=X --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" )
|
|
||||||
ALL_CHANGED=$(git diff --diff-filter='*' --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" )
|
|
||||||
|
|
||||||
echo "Getting diff..."
|
echo "Getting diff..."
|
||||||
|
ADDED=$(git diff --diff-filter=A --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" | sed -E 's/(${{ inputs.separator }})$//')
|
||||||
|
COPIED=$(git diff --diff-filter=C --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" | sed -E 's/(${{ inputs.separator }})$//')
|
||||||
|
DELETED=$(git diff --diff-filter=D --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" | sed -E 's/(${{ inputs.separator }})$//')
|
||||||
|
MODIFIED=$(git diff --diff-filter=M --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" | sed -E 's/(${{ inputs.separator }})$//')
|
||||||
|
RENAMED=$(git diff --diff-filter=R --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" | sed -E 's/(${{ inputs.separator }})$//')
|
||||||
|
CHANGED=$(git diff --diff-filter=T --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" | sed -E 's/(${{ inputs.separator }})$//')
|
||||||
|
UNMERGED=$(git diff --diff-filter=U --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" | sed -E 's/(${{ inputs.separator }})$//')
|
||||||
|
UNKNOWN=$(git diff --diff-filter=X --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" | sed -E 's/(${{ inputs.separator }})$//')
|
||||||
|
ALL_CHANGED=$(git diff --diff-filter='*ACDMRTUX' --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" | sed -E 's/(${{ inputs.separator }})$//')
|
||||||
|
ALL_MODIFIED_FILES=$(git diff --diff-filter='ACM' --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" | sed -E 's/(${{ inputs.separator }})$//')
|
||||||
|
|
||||||
|
|
||||||
echo "::set-output name=added_files::$ADDED"
|
echo "::set-output name=added_files::$ADDED"
|
||||||
echo "::set-output name=copied_files::$COPIED"
|
echo "::set-output name=copied_files::$COPIED"
|
||||||
echo "::set-output name=deleted_files::$DELETED"
|
echo "::set-output name=deleted_files::$DELETED"
|
||||||
@@ -75,8 +76,9 @@ runs:
|
|||||||
echo "::set-output name=unmerged_files::$UNMERGED"
|
echo "::set-output name=unmerged_files::$UNMERGED"
|
||||||
echo "::set-output name=unknown_files::$UNKNOWN"
|
echo "::set-output name=unknown_files::$UNKNOWN"
|
||||||
echo "::set-output name=all_changed_files::$ALL_CHANGED"
|
echo "::set-output name=all_changed_files::$ALL_CHANGED"
|
||||||
|
echo "::set-output name=all_modified_files::$ALL_MODIFIED_FILES"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
icon: git-pull-request
|
icon: git-commit
|
||||||
color: white
|
color: white
|
||||||
|
|||||||
44
renovate.json
Normal file
44
renovate.json
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
"config:base"
|
||||||
|
],
|
||||||
|
"enabled": true,
|
||||||
|
"prHourlyLimit": 10,
|
||||||
|
"prConcurrentLimit": 5,
|
||||||
|
"rebaseWhen": "behind-base-branch",
|
||||||
|
"addLabels": [
|
||||||
|
"dependencies"
|
||||||
|
],
|
||||||
|
"assignees": [
|
||||||
|
"jackton1"
|
||||||
|
],
|
||||||
|
"assignAutomerge": true,
|
||||||
|
"dependencyDashboard": true,
|
||||||
|
"dependencyDashboardAutoclose": true,
|
||||||
|
"lockFileMaintenance": {
|
||||||
|
"enabled": true,
|
||||||
|
"automerge": true
|
||||||
|
},
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
|
||||||
|
"automerge": true,
|
||||||
|
"rebaseWhen": "behind-base-branch",
|
||||||
|
"addLabels": [
|
||||||
|
"automerge"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "docker images",
|
||||||
|
"matchLanguages": [
|
||||||
|
"docker"
|
||||||
|
],
|
||||||
|
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
|
||||||
|
"rebaseWhen": "behind-base-branch",
|
||||||
|
"addLabels": [
|
||||||
|
"automerge"
|
||||||
|
],
|
||||||
|
"automerge": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user