Compare commits

...

16 Commits

Author SHA1 Message Date
Tonye Jack
8e7cc77ab9 Fixed bug setting the server URL for github enterprise server (#198)
* Update action.yml

* Update entrypoint.sh

* Update entrypoint.sh

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-09-26 02:32:59 -04:00
Tonye Jack
5a6b6bb1c3 Update test.yml 2021-09-26 02:32:37 -04:00
Renovate Bot
1f37ab54c8 Update reviewdog/action-shellcheck action to v1.9 2021-09-25 05:33:38 -04:00
Tonye Jack
6757c5e650 Update README.md 2021-09-19 20:47:25 -04:00
Tonye Jack
be5c441f0d Update README.md 2021-09-19 20:45:52 -04:00
Tonye Jack
343bc3cc2f Update README.md 2021-09-19 20:45:21 -04:00
Tonye Jack
1a59b03b8b Updated test (#195) 2021-09-19 20:44:31 -04:00
Tonye Jack
1ac83f052b Updated README.md (#194)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2021-09-19 20:41:05 -04:00
Tonye Jack
3b5a8e6656 Update README.md 2021-09-19 19:58:07 -04:00
dependabot[bot]
223c35895d Bump tj-actions/branch-names from 4.9 to 5 (#193)
Bumps [tj-actions/branch-names](https://github.com/tj-actions/branch-names) from 4.9 to 5.
- [Release notes](https://github.com/tj-actions/branch-names/releases)
- [Changelog](https://github.com/tj-actions/branch-names/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/branch-names/compare/v4.9...v5)

---
updated-dependencies:
- dependency-name: tj-actions/branch-names
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-14 21:08:57 -04:00
Tonye Jack
13c082a4b3 Updated README.md (#192)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2021-09-08 13:56:33 -04:00
Tonye Jack
966bf442ea Update README.md 2021-09-08 13:20:02 -04:00
Tonye Jack
32f883f2c8 Update README.md 2021-09-06 11:09:47 -04:00
jackton12
61622b6c0a Updated README.md 2021-09-05 19:36:22 -04:00
jackton12
4ed079e554 Updated README.md 2021-09-05 19:35:44 -04:00
Tonye Jack
d18cfbea8d Upgraded from v1.1.1 -> v1.1.2 (#190)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2021-09-05 15:32:05 -04:00
5 changed files with 69 additions and 52 deletions

View File

@@ -18,7 +18,7 @@ jobs:
- name: Checkout to branch
uses: actions/checkout@v2
- name: shellcheck
uses: reviewdog/action-shellcheck@v1.7
uses: reviewdog/action-shellcheck@v1.9
test-multiple-repositories:
name: Test with multiple repositories
@@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
platform: [ubuntu-latest, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022, windows-2016]
steps:
- name: Checkout into dir1
uses: actions/checkout@v2
@@ -79,7 +79,7 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
platform: [ubuntu-latest, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022, windows-2016]
steps:
- name: Checkout to branch
@@ -102,7 +102,7 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
platform: [ubuntu-latest, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022, windows-2016]
steps:
- name: Checkout
@@ -376,7 +376,7 @@ jobs:
bash
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v4.9
uses: tj-actions/branch-names@v5
- uses: nrwl/last-successful-commit-action@v1
id: last_successful_commit
with:

View File

@@ -1,5 +1,13 @@
# Changelog
## [v1.1.2](https://github.com/tj-actions/changed-files/tree/v1.1.2) (2021-09-05)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.1.1...v1.1.2)
**Merged pull requests:**
- Upgraded to v1.1.1 [\#189](https://github.com/tj-actions/changed-files/pull/189) ([jackton1](https://github.com/jackton1))
## [v1.1.1](https://github.com/tj-actions/changed-files/tree/v1.1.1) (2021-09-05)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.1.0...v1.1.1)
@@ -282,7 +290,7 @@
## [v7](https://github.com/tj-actions/changed-files/tree/v7) (2021-06-09)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6...v7)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.3...v7)
**Closed issues:**
@@ -298,13 +306,13 @@
- Update tj-actions/sync-release-version action to v8.7 [\#86](https://github.com/tj-actions/changed-files/pull/86) ([renovate[bot]](https://github.com/apps/renovate))
- Upgraded to v6.3 [\#85](https://github.com/tj-actions/changed-files/pull/85) ([jackton1](https://github.com/jackton1))
## [v6](https://github.com/tj-actions/changed-files/tree/v6) (2021-05-26)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.3...v6)
## [v6.3](https://github.com/tj-actions/changed-files/tree/v6.3) (2021-05-26)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.2...v6.3)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6...v6.3)
## [v6](https://github.com/tj-actions/changed-files/tree/v6) (2021-05-26)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.2...v6)
**Merged pull requests:**

View File

@@ -1,8 +1,12 @@
[![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) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/a3822d6c37f644bc99a5faa0bfb9c2c1)](https://www.codacy.com/gh/tj-actions/changed-files/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=tj-actions/changed-files\&utm_campaign=Badge_Grade) [![Public workflows that use this action.](https://img.shields.io/endpoint?url=https%3A%2F%2Fapi-tj-actions1.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3Dtj-actions%2Fchanged-files%26badge%3Dtrue)](https://github.com/search?o=desc\&q=tj-actions+changed-files+language%3AYAML\&s=\&type=Code)
[![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) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/a3822d6c37f644bc99a5faa0bfb9c2c1)](https://www.codacy.com/gh/tj-actions/changed-files/dashboard?utm\_source=github.com\&utm\_medium=referral\&utm\_content=tj-actions/changed-files\&utm\_campaign=Badge\_Grade) [![Public workflows that use this action.](https://img.shields.io/endpoint?url=https%3A%2F%2Fapi-tj-actions1.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3Dtj-actions%2Fchanged-files%26badge%3Dtrue)](https://github.com/search?o=desc\&q=tj-actions+changed-files+language%3AYAML\&s=\&type=Code)
[![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?logo=ubuntu\&logoColor=white)](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob\_idruns-on)
[![Mac OS](https://img.shields.io/badge/mac%20os-000000?logo=macos\&logoColor=F0F0F0)](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob\_idruns-on)
[![Windows](https://img.shields.io/badge/Windows-0078D6?logo=windows\&logoColor=white)](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob\_idruns-on)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all\_contributors-4-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
@@ -12,6 +16,7 @@ Retrieve all changed files relative to the default branch (`pull_request*` based
## Features
* Fast execution.
* Easy to debug.
* Boolean output indicating that certain files have been modified.
* Multiple repository support.
@@ -22,12 +27,6 @@ Retrieve all changed files relative to the default branch (`pull_request*` based
* Report on files that have at least one change.
* [Regex pattern](https://www.gnu.org/software/grep/manual/grep.html#Regular-Expressions) matching on a subset of files.
## Supported Platforms
* [`ubuntu-*`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
* [`macos-*`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
* [`windows-*`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
## Usage
> NOTE: :warning:
@@ -57,7 +56,7 @@ jobs:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v1.1.1
uses: tj-actions/changed-files@v1.1.2
- name: List all modified files
run: |
@@ -81,32 +80,33 @@ jobs:
| Output | type | example | description |
|:--------------------:|:------------:|:----------------------------------:|:----------------------------------------:|
| any_changed | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has changed. <br /> i.e. *using a combination of all added, <br />copied, modified and renamed files (ACMR).* |
| only_changed | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input have changed. |
| any_deleted | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has been deleted. |
| only_deleted | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input has been deleted. |
| other_changed_files | `string` | `'new.txt path/to/file.png ...'` | Select all other changed files <br/> not listed in the files input <br /> i.e. *a combination of all added, <br /> copied and modified files (ACMR).* |
| all_modified_files | `string` | `'new.txt path/to/file.png ...'` | Select all modified files <br /> i.e. *a combination of all added, <br />copied, modified and renamed files (ACMR).* |
| all_changed_and_modified_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed <br /> and modified files <br /> i.e. *a combination of (ACMRDTUX).* |
| added_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Added (A) |
| copied_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Copied (C) |
| deleted_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Deleted (D) |
| modified_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Modified (M) |
| renamed_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Renamed (R) |
| type_changed_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that have their file type changed (T) |
| unmerged_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Unmerged (U) |
| unknown_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Unknown (X) |
| any\_changed | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has changed. <br /> i.e. *using a combination of all added, <br />copied, modified and renamed files (ACMR).* |
| only\_changed | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input have changed. (ACMR) |
| other\_changed\_files | `string` | `'new.txt path/to/file.png ...'` | Select all other changed files <br/> not listed in the files input <br /> i.e. *a combination of all added, <br /> copied and modified files (ACMR).* |
| any\_deleted | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has been deleted. (D).\* |
| only\_deleted | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input has been deleted. (D) |
| other\_deleted\_files | `string` | `'new.txt path/to/file.png ...'` | Select all other deleted files <br/> not listed in the files input <br /> i.e. *a combination of all deleted files (D).* |
| all\_modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select all modified files <br /> i.e. a combination of all added, <br />copied, modified and renamed files (ACMR).\* |
| all\_changed\_and\_modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed <br /> and modified files <br /> i.e. *a combination of (ACMRDTUX).* |
| added\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Added (A) |
| copied\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Copied (C) |
| deleted\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Deleted (D) |
| modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Modified (M) |
| renamed\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Renamed (R) |
| type\_changed\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that have their file type changed (T) |
| unmerged\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Unmerged (U) |
| unknown\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Unknown (X) |
## Inputs
| Input | type | required | default | description |
|:-------------:|:-----------:|:-------------:|:-----------------------------:|:-------------:|
| 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 |
| files | `string` OR `string[]` | `false` | | Check for changes <br> using only these <br> list of file(s) <br> (Defaults to the <br> entire repo) |
| base_sha | `string` | `false` | | Specify a different <br> base commit SHA <br> used for <br> comparing changes |
| base\_sha | `string` | `false` | | Specify a different <br> base commit SHA <br> used for <br> comparing changes |
| sha | `string` | `true` | `${{ github.sha }}` | Specify a different <br> commit SHA <br> used for <br> comparing changes |
| files_from_source_file | `string` | `false` | | Source file <br> used to populate <br> the files input |
| files\_from\_source\_file | `string` | `false` | | Source file <br> used to populate <br> the files input |
| path | `string` | `false` | | Relative path under <br> `GITHUB_WORKSPACE` <br> to the repository |
## Example
@@ -118,11 +118,11 @@ jobs:
- name: Get changed files using defaults
id: changed-files
uses: tj-actions/changed-files@v1.1.1
uses: tj-actions/changed-files@v1.1.2
- name: Get changed files using a comma separator
id: changed-files-comma
uses: tj-actions/changed-files@v1.1.1
uses: tj-actions/changed-files@v1.1.2
with:
separator: ","
@@ -144,7 +144,7 @@ jobs:
- name: Get specific changed files
id: changed-files-specific
uses: tj-actions/changed-files@v1.1.1
uses: tj-actions/changed-files@v1.1.2
with:
files: |
my-file.txt
@@ -182,14 +182,14 @@ jobs:
- name: Use a source file or list of file(s) to populate to files input.
id: changed-files-specific-source-file
uses: tj-actions/changed-files@v1.1.1
uses: tj-actions/changed-files@v1.1.2
with:
files_from_source_file: |
test/changed-files-list.txt
- name: Use a source file or list of file(s) to populate to files input and optionally specify more files.
id: changed-files-specific-source-file-and-specify-files
uses: tj-actions/changed-files@v1.1.1
uses: tj-actions/changed-files@v1.1.2
with:
files_from_source_file: |
test/changed-files-list.txt
@@ -198,13 +198,13 @@ jobs:
- name: Use a different commit SHA
id: changed-files-custom-sha
uses: tj-actions/changed-files@v1.1.1
uses: tj-actions/changed-files@v1.1.2
with:
sha: ${{ github.event.pull_request.head.sha }}
- name: Use a different base SHA
id: changed-files-custom-base-sha
uses: tj-actions/changed-files@v1.1.1
uses: tj-actions/changed-files@v1.1.2
with:
base_sha: "2096ed0"
@@ -212,13 +212,19 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
path: subfolder
path: dir1
- name: Run changed-files with defaults on the dir1
id: changed-files-for-subfolder
uses: tj-actions/changed-files@v1.1.1
id: changed-files-for-dir1
uses: tj-actions/changed-files@v1.1.2
with:
path: subfolder
path: dir1
- name: List all added files in dir1
run: |
for file in "${{ steps.changed-files-for-dir1.outputs.added_files }}"; do
echo "$file was added"
done
```
### Running [pre-commit](https://pre-commit.com/) on all modified files
@@ -232,7 +238,7 @@ jobs:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v1.1.1
uses: tj-actions/changed-files@v1.1.2
- name: Pre-commit
uses: pre-commit/action@v2.0.0

View File

@@ -94,8 +94,9 @@ runs:
id: changed-files
shell: bash
env:
GITHUB_BASE_REF: ${{ github.base_ref }}
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_BASE_REF: ${{ github.base_ref }}
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
INPUT_SHA: ${{ inputs.sha }}

View File

@@ -15,7 +15,9 @@ if [[ -n $INPUT_PATH ]]; then
cd "$REPO_DIR"
fi
git remote add temp_changed_files "https://${INPUT_TOKEN}@github.com/${GITHUB_REPOSITORY}"
SERVER_URL=$(echo "$GITHUB_SERVER_URL" | awk -F/ '{print $3}')
git remote add temp_changed_files "https://${INPUT_TOKEN}@${SERVER_URL}/${GITHUB_REPOSITORY}"
echo "Getting HEAD info..."