Compare commits

...

64 Commits
v1 ... v3

Author SHA1 Message Date
Tonye Jack
e18ccae8fe Update README.md 2021-04-02 09:06:46 -04:00
Tonye Jack
ffb6aef8bf Update README.md 2021-04-02 09:04:54 -04:00
Tonye Jack
fd4add0d40 Update README.md 2021-04-02 09:03:50 -04:00
Tonye Jack
049242589c Merge pull request #11 from tj-actions/updated-the-all-changed 2021-04-02 09:03:22 -04:00
Tonye Jack
33a185bbac Update test.yml 2021-04-02 09:00:06 -04:00
Tonye Jack
122b223c04 Update test.yml 2021-04-02 08:56:53 -04:00
Tonye Jack
78d6add10d Update test.yml 2021-04-02 08:54:37 -04:00
Tonye Jack
ca86f77326 Update test.yml 2021-04-02 08:52:58 -04:00
Tonye Jack
56c6262bb9 Merge branch 'main' into updated-the-all-changed 2021-04-02 08:51:02 -04:00
Tonye Jack
1c5a3415f3 Update test.yml 2021-04-02 08:49:56 -04:00
Tonye Jack
48835883f9 Update test.yml 2021-04-02 08:46:17 -04:00
Tonye Jack
8673629857 Update test.yml 2021-04-02 08:45:11 -04:00
Tonye Jack
a4321716fa Update test.yml 2021-04-02 08:44:13 -04:00
Tonye Jack
c29faf8e4f Merge branch 'main' into updated-the-all-changed 2021-04-02 08:41:58 -04:00
Tonye Jack
c2eb99504f Update test.yml 2021-04-02 08:41:38 -04:00
Tonye Jack
21c1f27d33 Update action.yml 2021-04-02 08:37:45 -04:00
Tonye Jack
6c66f86688 Merge pull request #10 from tj-actions/jackton1-patch-1 2021-04-02 08:30:43 -04:00
Tonye Jack
3a11f58d0f Update README.md 2021-04-02 08:30:22 -04:00
Tonye Jack
fc280adde0 Merge branch 'main' into jackton1-patch-1 2021-04-02 08:28:26 -04:00
Tonye Jack
66a53ea26f Update test.yml 2021-04-02 08:28:14 -04:00
Tonye Jack
6868b512ca Update test.yml 2021-04-02 08:27:48 -04:00
Tonye Jack
d3c7a0c249 Update README.md 2021-04-02 08:22:12 -04:00
Tonye Jack
3a74bab53c Update README.md 2021-04-02 08:17:42 -04:00
Tonye Jack
f41f9eb54b Update test.yml 2021-04-02 08:13:34 -04:00
Tonye Jack
ea54bfb72a Update README.md 2021-04-02 08:08:05 -04:00
Tonye Jack
68680cd505 Update README.md 2021-04-01 07:43:05 -04:00
Tonye Jack
a66004fa3e Updated .github/workflows/auto-approve.yml 2021-03-28 16:31:32 -04:00
Tonye Jack
869aee8642 Deleted .github/auto-approve.yml 2021-03-28 16:27:02 -04:00
Tonye Jack
cd917a1be7 Added .github/auto-approve.yml 2021-03-28 15:20:57 -04:00
Tonye Jack
f003c2bfa4 Updated .github/FUNDING.yml 2021-03-28 15:13:36 -04:00
Tonye Jack
40de2adecb Added .github/workflows/auto-approve.yml 2021-03-27 12:45:50 -04:00
Tonye Jack
69750fb30a Merge pull request #8 from tj-actions/test-example 2021-03-25 19:24:03 -04:00
Tonye Jack
78af41436f Update test.yml 2021-03-25 19:23:19 -04:00
Tonye Jack
12a63a5a84 Merge pull request #9 from tj-actions/renovate/configure
Configure Renovate
2021-03-25 19:22:12 -04:00
Renovate Bot
d3cc0d7b88 Add renovate.json 2021-03-25 14:59:28 +00:00
Tonye Jack
3a416d7bb8 Create FUNDING.yml 2021-03-25 06:52:15 -04:00
Tonye Jack
8a0c8897e3 Update test.yml 2021-03-20 08:09:58 -04:00
Tonye Jack
09028ea846 Merge pull request #6 from tj-actions/upgrade-to-v2.1
Upgraded to v2.1
2021-03-18 08:28:19 -04:00
jackton1
2d4ff74f14 Upgraded from v2 -> v2.1 2021-03-18 11:34:47 +00:00
Tonye Jack
e1d275d6d3 Update action.yml 2021-03-18 07:33:12 -04:00
Tonye Jack
d048f47c2d Update action.yml 2021-03-18 07:32:07 -04:00
Tonye Jack
3e1a5a0bbb Delete HISTORY.md 2021-03-14 15:47:41 -04:00
Tonye Jack
c9d7fbfa0b Merge pull request #5 from tj-actions/upgrade-to-v2
Upgraded to v2
2021-03-14 15:46:58 -04:00
Tonye Jack
b3f247794c Update README.md 2021-03-14 15:45:59 -04:00
Tonye Jack
9977eb95fd Update README.md 2021-03-14 15:45:24 -04:00
jackton1
b2955a59c4 Upgraded from v1 -> v2 2021-03-14 19:45:03 +00:00
Tonye Jack
5eaa2d80dd Update README.md 2021-03-14 15:42:54 -04:00
Tonye Jack
eacae5936a Update README.md 2021-03-10 19:59:43 -05:00
Tonye Jack
cf6221a4b5 Update README.md 2021-03-10 19:59:05 -05:00
Tonye Jack
fbedd6101a Update README.md 2021-03-10 19:58:07 -05:00
Tonye Jack
f4e014f855 Update README.md 2021-03-10 19:57:53 -05:00
Tonye Jack
d17d3f38e4 Update README.md 2021-03-10 19:41:43 -05:00
Tonye Jack
c9641bed95 Update sync-release-version.yml 2021-03-10 19:40:11 -05:00
Tonye Jack
6225b0e9ee Merge pull request #4 from tj-actions/bug/fix-end-of-string
Fixed end of string with separator
2021-03-10 19:38:24 -05:00
Tonye Jack
50f3d5fc1b Update HISTORY.md 2021-03-10 19:37:35 -05:00
Tonye Jack
181cc0611b Fixed end of string with separator 2021-03-10 19:36:33 -05:00
Tonye Jack
fa940d172e Update label-conflict.yml 2021-03-08 16:15:47 -05:00
Tonye Jack
c19401a7a4 Update label-conflict.yml 2021-03-08 16:13:26 -05:00
Tonye Jack
ad6929ba2c Update label-conflict.yml 2021-03-08 16:09:16 -05:00
Tonye Jack
ed79e46837 Update README.md 2021-03-08 16:03:04 -05:00
Tonye Jack
6d50907015 Create label-conflict.yml 2021-03-08 15:59:17 -05:00
Tonye Jack
15c871605e Update README.md 2021-03-05 07:51:10 -05:00
Tonye Jack
b13dd562b4 Update README.md 2021-03-05 07:49:00 -05:00
Tonye Jack
ee1e50f1df Update README.md 2021-03-05 07:44:03 -05:00
10 changed files with 178 additions and 25 deletions

12
.github/FUNDING.yml vendored Normal file
View 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: []

19
.github/workflows/auto-approve.yml vendored Normal file
View 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
View 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."

View File

@@ -16,6 +16,8 @@ jobs:
pattern: 'tj-actions/changed-files@'
paths: |
README.md
- name: Generate CHANGELOG
uses: tj-actions/github-changelog-generator@v1.3
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:

View File

@@ -16,16 +16,30 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Run changed-files with defaults
if: github.event_name == 'pull_request'
id: changed-files
uses: ./
- name: Show output
if: github.event_name == 'pull_request'
run: |
echo "${{ toJSON(steps.changed-files.outputs) }}"
- name: List all modified files
if: github.event_name == 'pull_request'
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
if: github.event_name == 'pull_request'
id: changed-files-comma
uses: ./
with:
separator: ","
- name: Show output
if: github.event_name == 'pull_request'
run: |
echo "${{ toJSON(steps.changed-files-comma.outputs) }}"

29
CHANGELOG.md Normal file
View File

@@ -0,0 +1,29 @@
# Changelog
## [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)*

View File

@@ -1,8 +0,0 @@
History
-------
v1 (2021-03-04)
------------------
* Initial Release.

View File

@@ -1,14 +1,44 @@
[![CI](https://github.com/tj-actions/changed-files/actions/workflows/test.yml/badge.svg)](https://github.com/tj-actions/changed-files/actions/workflows/test.yml) [![Update release version.](https://github.com/tj-actions/changed-files/actions/workflows/sync-release-version.yml/badge.svg)](https://github.com/tj-actions/changed-files/actions/workflows/sync-release-version.yml)
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
...
steps:
- uses: actions/checkout@v2
- name: Get modified files
uses: tj-actions/changed-files@v1
- name: Get changed files using defaults
id: changed-files
uses: tj-actions/changed-files@v2.1
- name: Get changed files using a comma separator
id: changed-files-comma
uses: tj-actions/changed-files@v2.1
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."
```
@@ -16,16 +46,47 @@ Get modified files
| 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. |
## Example
![Screen Shot 2021-04-02 at 9 06 04 AM](https://user-images.githubusercontent.com/17484350/113418057-b9fff600-9392-11eb-84e5-f5a91bfa8b11.png)
* Free software: [MIT license](LICENSE)
Features
--------
* TODO
- Added Files
- Copied Files
- Deleted Files
- Modified Files
- Renamed Files
- Changed Files
- Unmerged Files
- Unknown Files
- All Changed Files
Credits

View File

@@ -1,5 +1,5 @@
name: Get modified files
description: Get modified files
name: Diff changed files
description: Diff changed files
author: tj-actions
inputs:
separator:
@@ -55,15 +55,15 @@ runs:
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 }}" )
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 }})$//')
echo "Getting diff..."
echo "::set-output name=added_files::$ADDED"

5
renovate.json Normal file
View File

@@ -0,0 +1,5 @@
{
"extends": [
"config:base"
]
}