Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
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."
|
||||||
2
.github/workflows/sync-release-version.yml
vendored
2
.github/workflows/sync-release-version.yml
vendored
@@ -16,6 +16,8 @@ jobs:
|
|||||||
pattern: 'tj-actions/changed-files@'
|
pattern: 'tj-actions/changed-files@'
|
||||||
paths: |
|
paths: |
|
||||||
README.md
|
README.md
|
||||||
|
- name: Generate CHANGELOG
|
||||||
|
uses: tj-actions/github-changelog-generator@v1.3
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v3
|
uses: peter-evans/create-pull-request@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
21
CHANGELOG.md
Normal file
21
CHANGELOG.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [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)*
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
History
|
|
||||||
-------
|
|
||||||
|
|
||||||
|
|
||||||
v1 (2021-03-04)
|
|
||||||
------------------
|
|
||||||
|
|
||||||
* Initial Release.
|
|
||||||
56
README.md
56
README.md
@@ -1,14 +1,33 @@
|
|||||||
|
[](https://github.com/tj-actions/changed-files/actions/workflows/test.yml) [](https://github.com/tj-actions/changed-files/actions/workflows/sync-release-version.yml)
|
||||||
|
|
||||||
changed-files
|
changed-files
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
Get modified files
|
Get modified files using [`git diff --diff-filter`](https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---diff-filterACDMRTUXB82308203) to locate all files that have been modified relative to the default branch.
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Get modified files
|
- name: Get modified files using defaults
|
||||||
uses: tj-actions/changed-files@v1
|
id: changed-files
|
||||||
|
uses: tj-actions/changed-files@v2
|
||||||
|
|
||||||
|
- name: Get modified files using a comma separator
|
||||||
|
id: changed-files-comma
|
||||||
|
uses: tj-actions/changed-files@v2
|
||||||
|
with:
|
||||||
|
separator: ","
|
||||||
|
|
||||||
|
- name: List all added files
|
||||||
|
run: |
|
||||||
|
for file in "${{ steps.changed-files.outputs.added_files }}"; do
|
||||||
|
echo $file
|
||||||
|
done
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -16,16 +35,43 @@ 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 (*) are selected if there <br/> is any file that matches other <br/> criteria in the comparison; <br/> if there is no file that <br/> matches other criteria, <br/> nothing is selected. |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Free software: [MIT license](LICENSE)
|
* Free software: [MIT license](LICENSE)
|
||||||
|
|
||||||
|
|
||||||
Features
|
Features
|
||||||
--------
|
--------
|
||||||
|
- Added Files
|
||||||
|
- Copied Files
|
||||||
|
- Deleted Files
|
||||||
|
- Modified Files
|
||||||
|
- Renamed Files
|
||||||
|
- Changed Files
|
||||||
|
- Unmerged Files
|
||||||
|
- Unknown Files
|
||||||
|
- All Changed Files
|
||||||
|
|
||||||
* TODO
|
|
||||||
|
|
||||||
|
|
||||||
Credits
|
Credits
|
||||||
|
|||||||
22
action.yml
22
action.yml
@@ -1,5 +1,5 @@
|
|||||||
name: Get modified files
|
name: Diff changed files
|
||||||
description: Get modified files
|
description: Diff changed files
|
||||||
author: tj-actions
|
author: tj-actions
|
||||||
inputs:
|
inputs:
|
||||||
separator:
|
separator:
|
||||||
@@ -55,15 +55,15 @@ runs:
|
|||||||
|
|
||||||
HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true)
|
HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true)
|
||||||
|
|
||||||
ADDED=$(git diff --diff-filter=A --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" )
|
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 }}" )
|
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 }}" )
|
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 }}" )
|
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 }}" )
|
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 }}" )
|
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 }}" )
|
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 }}" )
|
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='*' --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" )
|
ALL_CHANGED=$(git diff --diff-filter='*' --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" | sed -E 's/(${{ inputs.separator }})$//')
|
||||||
|
|
||||||
echo "Getting diff..."
|
echo "Getting diff..."
|
||||||
echo "::set-output name=added_files::$ADDED"
|
echo "::set-output name=added_files::$ADDED"
|
||||||
|
|||||||
Reference in New Issue
Block a user