Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c66aa285d | ||
|
|
8fac2f4376 | ||
|
|
fb196bcc0b | ||
|
|
a35dac8406 | ||
|
|
338eaa4eac | ||
|
|
ac8a08a71b | ||
|
|
1c8bd519b4 | ||
|
|
745cc73fef | ||
|
|
a0089a8516 | ||
|
|
277a3bc1fc | ||
|
|
2640644727 | ||
|
|
557228b7f1 | ||
|
|
9f7f868dd0 | ||
|
|
1f4d9f16e1 | ||
|
|
16dd720838 | ||
|
|
afa4cd137b | ||
|
|
47c1f9d2a2 |
23
.github/workflows/auto-merge.yml
vendored
Normal file
23
.github/workflows/auto-merge.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: automerge
|
||||||
|
on:
|
||||||
|
check_suite:
|
||||||
|
types:
|
||||||
|
- rerequested
|
||||||
|
- completed
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
automerge:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: |
|
||||||
|
github.actor == 'dependabot[bot]' ||
|
||||||
|
github.actor == 'dependabot'
|
||||||
|
steps:
|
||||||
|
- name: automerge
|
||||||
|
uses: pascalgn/automerge-action@v0.14.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
|
||||||
|
MERGE_METHOD: "rebase"
|
||||||
|
UPDATE_METHOD: "rebase"
|
||||||
|
MERGE_RETRIES: "6"
|
||||||
|
MERGE_RETRY_SLEEP: "100000"
|
||||||
|
MERGE_LABELS: ""
|
||||||
4
.github/workflows/rebase.yml
vendored
4
.github/workflows/rebase.yml
vendored
@@ -8,11 +8,11 @@ jobs:
|
|||||||
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
|
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.3.4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT_TOKEN }}
|
token: ${{ secrets.PAT_TOKEN }}
|
||||||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
|
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
|
||||||
- name: Automatic Rebase
|
- name: Automatic Rebase
|
||||||
uses: cirrus-actions/rebase@1.4
|
uses: cirrus-actions/rebase@1.5
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
|
||||||
|
|||||||
4
.github/workflows/sync-release-version.yml
vendored
4
.github/workflows/sync-release-version.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
|||||||
update-version:
|
update-version:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.3.4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Sync release version.
|
- name: Sync release version.
|
||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
output: 'HISTORY.md'
|
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.9.2
|
||||||
with:
|
with:
|
||||||
base: "main"
|
base: "main"
|
||||||
title: "Upgraded to ${{ steps.sync-release-version.outputs.new_version }}"
|
title: "Upgraded to ${{ steps.sync-release-version.outputs.new_version }}"
|
||||||
|
|||||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
name: Test changed-files
|
name: Test changed-files
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2.3.4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Run changed-files with defaults
|
- name: Run changed-files with defaults
|
||||||
|
|||||||
32
HISTORY.md
32
HISTORY.md
@@ -1,5 +1,33 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [v6](https://github.com/tj-actions/changed-files/tree/v6) (2021-05-14)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v5.3...v6)
|
||||||
|
|
||||||
|
**Closed issues:**
|
||||||
|
|
||||||
|
- Improve test coverage [\#54](https://github.com/tj-actions/changed-files/issues/54)
|
||||||
|
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Bump peter-evans/create-pull-request from 3.9.1 to 3.9.2 [\#63](https://github.com/tj-actions/changed-files/pull/63) ([dependabot[bot]](https://github.com/apps/dependabot))
|
||||||
|
- Deprecate all\_changed output. [\#62](https://github.com/tj-actions/changed-files/pull/62) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Bump peter-evans/create-pull-request from 3 to 3.9.1 [\#61](https://github.com/tj-actions/changed-files/pull/61) ([dependabot[bot]](https://github.com/apps/dependabot))
|
||||||
|
- Bump actions/checkout from 2 to 2.3.4 [\#60](https://github.com/tj-actions/changed-files/pull/60) ([dependabot[bot]](https://github.com/apps/dependabot))
|
||||||
|
- Fixed typo [\#58](https://github.com/tj-actions/changed-files/pull/58) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v5.3 [\#57](https://github.com/tj-actions/changed-files/pull/57) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v5.3](https://github.com/tj-actions/changed-files/tree/v5.3) (2021-05-08)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v5.2...v5.3)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Add warning message when the head sha is empty [\#56](https://github.com/tj-actions/changed-files/pull/56) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Update tj-actions/sync-release-version action to v8.6 [\#55](https://github.com/tj-actions/changed-files/pull/55) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
|
- Upgraded to v5.2 [\#53](https://github.com/tj-actions/changed-files/pull/53) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v5.2](https://github.com/tj-actions/changed-files/tree/v5.2) (2021-05-06)
|
## [v5.2](https://github.com/tj-actions/changed-files/tree/v5.2) (2021-05-06)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v5.1...v5.2)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v5.1...v5.2)
|
||||||
@@ -9,10 +37,6 @@
|
|||||||
- \[shellcheck\]: Resolve SC2001 [\#42](https://github.com/tj-actions/changed-files/issues/42)
|
- \[shellcheck\]: Resolve SC2001 [\#42](https://github.com/tj-actions/changed-files/issues/42)
|
||||||
- \[shellcheck\]: Resolve SC2128 [\#41](https://github.com/tj-actions/changed-files/issues/41)
|
- \[shellcheck\]: Resolve SC2128 [\#41](https://github.com/tj-actions/changed-files/issues/41)
|
||||||
|
|
||||||
**Closed issues:**
|
|
||||||
|
|
||||||
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- Update tj-actions/github-changelog-generator action to v1.8 [\#52](https://github.com/tj-actions/changed-files/pull/52) ([renovate[bot]](https://github.com/apps/renovate))
|
- Update tj-actions/github-changelog-generator action to v1.8 [\#52](https://github.com/tj-actions/changed-files/pull/52) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
|
|||||||
29
README.md
29
README.md
@@ -3,7 +3,7 @@
|
|||||||
changed-files
|
changed-files
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
Get all modified files relative to the default branch (`pull_request*` events) or last commit (`push` event).
|
Retrieve all changed, added, modified and deleted files relative to the default branch (`pull_request*` events) or last commit (`push` event).
|
||||||
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
@@ -11,8 +11,7 @@ Get all modified files relative to the default branch (`pull_request*` events) o
|
|||||||
- Between the current pull request branch and the default branch
|
- Between the current pull request branch and the default branch
|
||||||
- Between the last commit and the current pushed change.
|
- Between the last commit and the current pushed change.
|
||||||
- Restrict change detection to a subset of files.
|
- Restrict change detection to a subset of files.
|
||||||
- Report on files that have all changed.
|
- Report on files that have at least one change.
|
||||||
- Report on files that have at least one file change.
|
|
||||||
- Regex pattern matching on a subset of files.
|
- Regex pattern matching on a subset of files.
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +47,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v5.2
|
uses: tj-actions/changed-files@v6
|
||||||
|
|
||||||
- name: List all modified files
|
- name: List all modified files
|
||||||
run: |
|
run: |
|
||||||
@@ -74,7 +73,6 @@ jobs:
|
|||||||
|
|
||||||
| Output | type | example | description |
|
| Output | type | example | description |
|
||||||
|:-------------------:|:------------:|:------------------------------:|:----------------------------------------:|
|
|:-------------------:|:------------:|:------------------------------:|:----------------------------------------:|
|
||||||
| all_changed | `string` | `true` OR `false` | Returns `true` only when the filenames provided using the `files` input have all changed |
|
|
||||||
| any_changed | `string` | `true` OR `false` | Returns `true` when any of the filenames provided using the `files` input has changed |
|
| any_changed | `string` | `true` OR `false` | Returns `true` when any of the filenames provided using the `files` input has changed |
|
||||||
| 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).* |
|
| 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).* |
|
||||||
| all_changed_files | `string` | `'new.txt other.png ...'` | Select all paths (*) <br /> *i.e a combination of all options below.* |
|
| all_changed_files | `string` | `'new.txt other.png ...'` | Select all paths (*) <br /> *i.e a combination of all options below.* |
|
||||||
@@ -94,7 +92,7 @@ jobs:
|
|||||||
|:-------------:|:-----------:|:-------------:|:----------------------------:|:-------------:|
|
|:-------------:|:-----------:|:-------------:|:----------------------------:|:-------------:|
|
||||||
| token | `string` | `false` | `${{ github.token }}` | [GITHUB_TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) |
|
| token | `string` | `false` | `${{ github.token }}` | [GITHUB_TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) |
|
||||||
| separator | `string` | `true` | `' '` | Output string separator |
|
| separator | `string` | `true` | `' '` | Output string separator |
|
||||||
| files | `string` OR `string[]` | `false` | | Restricted list or string of specific <br> files or filename to watch for changes |
|
| files | `string` OR `string[]` | `false` | | Restricted list <br> or string of specific <br> files or filename <br> to watch for changes |
|
||||||
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
@@ -106,11 +104,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files using defaults
|
- name: Get changed files using defaults
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v5.2
|
uses: tj-actions/changed-files@v6
|
||||||
|
|
||||||
- name: Get changed files using a comma separator
|
- name: Get changed files using a comma separator
|
||||||
id: changed-files-comma
|
id: changed-files-comma
|
||||||
uses: tj-actions/changed-files@v5.2
|
uses: tj-actions/changed-files@v6
|
||||||
with:
|
with:
|
||||||
separator: ","
|
separator: ","
|
||||||
|
|
||||||
@@ -132,7 +130,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get specific changed files
|
- name: Get specific changed files
|
||||||
id: changed-files-specific
|
id: changed-files-specific
|
||||||
uses: tj-actions/changed-files@v5.2
|
uses: tj-actions/changed-files@v6
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
my-file.txt
|
my-file.txt
|
||||||
@@ -143,15 +141,10 @@ jobs:
|
|||||||
.(sql)$
|
.(sql)$
|
||||||
^(mynewfile|custom)
|
^(mynewfile|custom)
|
||||||
|
|
||||||
- name: Run step if all files listed above have changed
|
|
||||||
if: steps.changed-files-specific.outputs.all_changed == 'true'
|
|
||||||
run: |
|
|
||||||
echo "Both my-file.txt and test.txt have changed."
|
|
||||||
|
|
||||||
- name: Run step if any of the listed files above change
|
- name: Run step if any of the listed files above change
|
||||||
if: steps.changed-files-specific.outputs.any_changed == 'true'
|
if: steps.changed-files-specific.outputs.any_changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
echo "Either my-file.txt or test.txt have changed."
|
echo "One or more files listed above has changed."
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -166,7 +159,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v5.2
|
uses: tj-actions/changed-files@v6
|
||||||
|
|
||||||
- name: Pre-commit
|
- name: Pre-commit
|
||||||
uses: pre-commit/action@v2.0.0
|
uses: pre-commit/action@v2.0.0
|
||||||
@@ -179,9 +172,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|

|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Free software: [MIT license](LICENSE)
|
* Free software: [MIT license](LICENSE)
|
||||||
|
|||||||
26
action.yml
26
action.yml
@@ -46,9 +46,6 @@ outputs:
|
|||||||
all_modified_files:
|
all_modified_files:
|
||||||
description: List of all copied modified and added files
|
description: List of all copied modified and added files
|
||||||
value: ${{ steps.changed_files.outputs.all_modified_files }}
|
value: ${{ steps.changed_files.outputs.all_modified_files }}
|
||||||
all_changed:
|
|
||||||
description: Return true only when all files provided using the files input have all changed.
|
|
||||||
value: ${{ steps.changed_files.outputs.all_changed }}
|
|
||||||
any_changed:
|
any_changed:
|
||||||
description: Return true only when any files provided using the files input have changed.
|
description: Return true only when any files provided using the files input have changed.
|
||||||
value: ${{ steps.changed_files.outputs.any_changed }}
|
value: ${{ steps.changed_files.outputs.any_changed }}
|
||||||
@@ -75,7 +72,7 @@ runs:
|
|||||||
|
|
||||||
if [[ -z $HEAD_SHA ]]; then
|
if [[ -z $HEAD_SHA ]]; then
|
||||||
echo "::warning::Unable to determine the head sha: $HEAD_SHA."
|
echo "::warning::Unable to determine the head sha: $HEAD_SHA."
|
||||||
echo "::warning::You seem to be misssing `fetch-depth: 0` or `fetch-depth: 2`"
|
echo "::warning::You seem to be missing `fetch-depth: 0` or `fetch-depth: 2`"
|
||||||
else
|
else
|
||||||
echo "Using head sha: $HEAD_SHA..."
|
echo "Using head sha: $HEAD_SHA..."
|
||||||
|
|
||||||
@@ -145,29 +142,14 @@ runs:
|
|||||||
|
|
||||||
if [[ -n "$INPUT_FILES" ]]; then
|
if [[ -n "$INPUT_FILES" ]]; then
|
||||||
# shellcheck disable=SC2001
|
# shellcheck disable=SC2001
|
||||||
OUTPUT_ALL_MODIFIED_FILES=$(echo "$ALL_MODIFIED_FILES" | sed "s/$INPUT_SEPARATOR/ /g")
|
OUTPUT_ALL_MODIFIED_FILES=$(echo "$ALL_MODIFIED_FILES" | tr "$INPUT_SEPARATOR" " " | xargs)
|
||||||
ALL_INPUT_FILES=$(echo "$INPUT_FILES" | tr "\n" " " | xargs)
|
ALL_INPUT_FILES=$(echo "$INPUT_FILES" | tr "\n" " " | xargs)
|
||||||
|
|
||||||
echo "Input files: ${ALL_INPUT_FILES[@]}"
|
echo "Input files: ${ALL_INPUT_FILES[@]}"
|
||||||
echo "Output all modified files: ${OUTPUT_ALL_MODIFIED_FILES[@]}"
|
echo "Matching modified files: ${OUTPUT_ALL_MODIFIED_FILES[@]}"
|
||||||
|
|
||||||
SORTED_INPUT_FILES=()
|
if [[ ${#OUTPUT_ALL_MODIFIED_FILES[@]} -gt 0 ]]; then
|
||||||
SORTED_OUTPUT_ALL_MODIFIED_FILES=()
|
|
||||||
|
|
||||||
IFS=" " read -r -a SORTED_INPUT_FILES <<< "$(sort <<<"${ALL_INPUT_FILES[*]}")"
|
|
||||||
IFS=" " read -r -a SORTED_OUTPUT_ALL_MODIFIED_FILES <<< "$(sort <<<"${OUTPUT_ALL_MODIFIED_FILES[*]}")"
|
|
||||||
|
|
||||||
if [[ ${#SORTED_OUTPUT_ALL_MODIFIED_FILES[@]} -gt 0 ]]; then
|
|
||||||
echo "::set-output name=any_changed::true"
|
echo "::set-output name=any_changed::true"
|
||||||
|
|
||||||
echo "Sorted input files: ${SORTED_INPUT_FILES[@]}"
|
|
||||||
echo "Sorted output all modified files: ${SORTED_OUTPUT_ALL_MODIFIED_FILES[@]}"
|
|
||||||
|
|
||||||
if [[ "${SORTED_INPUT_FILES[*]}" == "${SORTED_OUTPUT_ALL_MODIFIED_FILES[*]}" ]]; then
|
|
||||||
echo "::set-output name=all_changed::true"
|
|
||||||
else
|
|
||||||
echo "::set-output name=all_changed::false"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "::set-output name=any_changed::false"
|
echo "::set-output name=any_changed::false"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user