Compare commits

..

60 Commits
v2.1 ... v3.2

Author SHA1 Message Date
Tonye Jack
8d5a33c603 Merge pull request #16 from tj-actions/feature/add-support-for-all-modified-files
Add support for all modified files
2021-04-11 17:59:11 -04:00
Tonye Jack
00d83b13d6 Update README.md 2021-04-11 17:57:15 -04:00
Tonye Jack
223d074d69 Add support for all modified files 2021-04-11 17:54:10 -04:00
Tonye Jack
d31b4186e9 Deleted .github/ISSUE_TEMPLATE.md 2021-04-09 08:28:43 -04:00
Tonye Jack
223ef07a3f Added .github/ISSUE_TEMPLATE/feature_request.md 2021-04-09 05:07:07 -04:00
Tonye Jack
5eeb83fa4e Added .github/ISSUE_TEMPLATE/bug_report.md 2021-04-09 05:06:00 -04:00
Tonye Jack
83e0ed24b0 Updated .github/workflows/sync-release-version.yml 2021-04-04 10:50:20 -04:00
Tonye Jack
737590d30e Update README.md 2021-04-04 09:11:55 -04:00
Tonye Jack
4c551d94e0 Merge pull request #14 from tj-actions/changed-triggered-events-test-action
Update test.yml
2021-04-04 09:08:38 -04:00
Tonye Jack
506d6c005e Update test.yml 2021-04-04 09:08:26 -04:00
Tonye Jack
fa5d79bbb3 Merge pull request #13 from tj-actions/upgrade-to-v3.1
Upgraded to v3.1
2021-04-04 09:06:07 -04:00
jackton1
c9e3c674ba Upgraded from v3 -> v3.1 2021-04-04 13:01:55 +00:00
Tonye Jack
fbfaba544e Update action.yml 2021-04-04 09:00:53 -04:00
Tonye Jack
417b634812 Updated .github/workflows/sync-release-version.yml 2021-04-02 12:43:14 -04:00
Tonye Jack
69ce8f5302 Update README.md 2021-04-02 12:06:01 -04:00
Tonye Jack
abf3dc48a6 Update README.md 2021-04-02 12:05:12 -04:00
Tonye Jack
36864ca8c6 Update README.md 2021-04-02 09:17:01 -04:00
Tonye Jack
689cd8a7ea Update README.md 2021-04-02 09:13:22 -04:00
Tonye Jack
715ae3d38e Update test.yml 2021-04-02 09:12:33 -04:00
Tonye Jack
a85fa79b00 Merge pull request #12 from tj-actions/upgrade-to-v3
Upgraded to v3
2021-04-02 09:11:02 -04:00
jackton1
bdade9e883 Upgraded from v2.1 -> v3 2021-04-02 13:10:37 +00:00
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
12 changed files with 232 additions and 24 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: []

View File

@@ -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
View 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.

View 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
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 }}

View File

@@ -9,15 +9,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Sync release version
with:
fetch-depth: 0
- name: Sync release version.
uses: tj-actions/sync-release-version@v8
id: sync-release-version
with:
pattern: 'tj-actions/changed-files@'
pattern: '${{ github.repository }}@'
paths: |
README.md
- name: Generate CHANGELOG
uses: tj-actions/github-changelog-generator@v1.3
with:
output: 'HISTORY.md'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:

View File

@@ -1,9 +1,6 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
@@ -21,6 +18,15 @@ jobs:
- name: Show output
run: |
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
id: changed-files-comma
uses: ./

View File

@@ -1,5 +1,25 @@
# 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)

49
HISTORY.md Normal file
View File

@@ -0,0 +1,49 @@
# Changelog
## [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))
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

View File

@@ -5,20 +5,50 @@ changed-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.
> NOTE: :warning: This action should only run on the following events :warning:
> * [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
With defaults
```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.1
```
## Example
```yaml
...
steps:
- uses: actions/checkout@v2
- name: Get modified files using defaults
- name: Get changed files using defaults
id: changed-files
uses: tj-actions/changed-files@v2
uses: tj-actions/changed-files@v3.1
- name: Get modified files using a comma separator
- name: Get changed files using a comma separator
id: changed-files-comma
uses: tj-actions/changed-files@v2
uses: tj-actions/changed-files@v3.1
with:
separator: ","
@@ -27,6 +57,17 @@ Get modified files using [`git diff --diff-filter`](https://git-scm.com/docs/git
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."
```
@@ -53,7 +94,13 @@ Using the default separator.
| 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. |
| 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
![Screen Shot 2021-04-02 at 9 06 04 AM](https://user-images.githubusercontent.com/17484350/113418057-b9fff600-9392-11eb-84e5-f5a91bfa8b11.png)
@@ -73,7 +120,6 @@ Features
- All Changed Files
Credits
-------

View File

@@ -1,5 +1,5 @@
name: Diff changed files
description: Diff changed files
name: Changed files
description: Get all changed files
author: tj-actions
inputs:
separator:
@@ -35,6 +35,9 @@ outputs:
all_changed_files:
description: List of all changed files.
value: ${{ steps.changed-files.outputs.all_changed_files }}
all_modified_files:
description: List of all changed modified and added files
value: ${{ steps.changed-files.outputs.all_modified_files }}
runs:
using: 'composite'
@@ -63,7 +66,8 @@ runs:
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='*' --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 "Getting diff..."
echo "::set-output name=added_files::$ADDED"
@@ -75,6 +79,7 @@ runs:
echo "::set-output name=unmerged_files::$UNMERGED"
echo "::set-output name=unknown_files::$UNKNOWN"
echo "::set-output name=all_changed_files::$ALL_CHANGED"
echo "::set-output name=all_modified_files::$ALL_MODIFIED_FILES"
shell: bash
branding:

5
renovate.json Normal file
View File

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