Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c0d12b627 | ||
|
|
3a01bb540d | ||
|
|
fba57fd3c6 | ||
|
|
7abdbc94e9 | ||
|
|
4f76fe6a8e | ||
|
|
1d1f2dec19 | ||
|
|
01fb130d1e | ||
|
|
031c7ba276 | ||
|
|
304c203f25 | ||
|
|
2e02d49f78 | ||
|
|
677631125b | ||
|
|
675ab58887 | ||
|
|
21a9d525da | ||
|
|
5a860fa1ae | ||
|
|
1b6483d0e7 |
49
.github/workflows/codacy-analysis.yml
vendored
Normal file
49
.github/workflows/codacy-analysis.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# This workflow checks out code, performs a Codacy security scan
|
||||
# and integrates the results with the
|
||||
# GitHub Advanced Security code scanning feature. For more information on
|
||||
# the Codacy security scan action usage and parameters, see
|
||||
# https://github.com/codacy/codacy-analysis-cli-action.
|
||||
# For more information on Codacy Analysis CLI in general, see
|
||||
# https://github.com/codacy/codacy-analysis-cli.
|
||||
|
||||
name: Codacy Security Scan
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ main ]
|
||||
schedule:
|
||||
- cron: '15 16 * * 2'
|
||||
|
||||
jobs:
|
||||
codacy-security-scan:
|
||||
name: Codacy Security Scan
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Checkout the repository to the GitHub Actions runner
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
|
||||
- name: Run Codacy Analysis CLI
|
||||
uses: codacy/codacy-analysis-cli-action@4.0.0
|
||||
with:
|
||||
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
|
||||
# You can also omit the token and run the tools that support default configurations
|
||||
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
||||
verbose: true
|
||||
output: results.sarif
|
||||
format: sarif
|
||||
# Adjust severity of non-security issues
|
||||
gh-code-scanning-compat: true
|
||||
# Force 0 exit code to allow SARIF file generation
|
||||
# This will handover control about PR rejection to the GitHub side
|
||||
max-allowed-issues: 2147483647
|
||||
|
||||
# Upload the SARIF file generated in the previous step
|
||||
- name: Upload SARIF results file
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
- name: Checkout to branch
|
||||
uses: actions/checkout@v2
|
||||
- name: shellcheck
|
||||
uses: reviewdog/action-shellcheck@v1.6
|
||||
uses: reviewdog/action-shellcheck@v1.7
|
||||
|
||||
test-no-head-sha:
|
||||
name: Test changed-files missing head sha
|
||||
|
||||
45
HISTORY.md
45
HISTORY.md
@@ -1,5 +1,46 @@
|
||||
# Changelog
|
||||
|
||||
## [v9](https://github.com/tj-actions/changed-files/tree/v9) (2021-07-24)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v8.9...v9)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- \[BUG\] \<any\_changed doesn't capture changes due to renaming files\> [\#144](https://github.com/tj-actions/changed-files/issues/144)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Update `any_changed` to include renamed files. [\#145](https://github.com/tj-actions/changed-files/pull/145) ([jackton1](https://github.com/jackton1))
|
||||
- Update codacy/codacy-analysis-cli-action action to v4 [\#143](https://github.com/tj-actions/changed-files/pull/143) ([renovate[bot]](https://github.com/apps/renovate))
|
||||
- Update codacy/codacy-analysis-cli-action action to v3 [\#142](https://github.com/tj-actions/changed-files/pull/142) ([renovate[bot]](https://github.com/apps/renovate))
|
||||
- Upgraded to v8.9 [\#140](https://github.com/tj-actions/changed-files/pull/140) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v8.9](https://github.com/tj-actions/changed-files/tree/v8.9) (2021-07-18)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v8.8...v8.9)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Updated README.md [\#139](https://github.com/tj-actions/changed-files/pull/139) ([jackton1](https://github.com/jackton1))
|
||||
- Upgraded to v8.8 [\#138](https://github.com/tj-actions/changed-files/pull/138) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v8.8](https://github.com/tj-actions/changed-files/tree/v8.8) (2021-07-17)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v8.7...v8.8)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- \[Feature\] Ability to run a workflow if and only if certain file/directory changes [\#124](https://github.com/tj-actions/changed-files/issues/124)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Added support for detecting non specific file changes. [\#137](https://github.com/tj-actions/changed-files/pull/137) ([jackton1](https://github.com/jackton1))
|
||||
- Upgraded to v8.7 [\#136](https://github.com/tj-actions/changed-files/pull/136) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v8.7](https://github.com/tj-actions/changed-files/tree/v8.7) (2021-07-17)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v8.6...v8.7)
|
||||
@@ -46,10 +87,6 @@
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v8.3...v8.4)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Update reviewdog/action-shellcheck action to v1.6 [\#118](https://github.com/tj-actions/changed-files/pull/118) ([renovate[bot]](https://github.com/apps/renovate))
|
||||
|
||||
31
README.md
31
README.md
@@ -55,7 +55,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v8.7
|
||||
uses: tj-actions/changed-files@v9
|
||||
|
||||
- name: List all modified files
|
||||
run: |
|
||||
@@ -79,10 +79,10 @@ jobs:
|
||||
|
||||
| Output | type | example | description |
|
||||
|:--------------------:|:------------:|:----------------------------------:|:----------------------------------------:|
|
||||
| any_changed | `string` | `true` OR `false` | Returns `true` when any of the filenames provided using the `files` input has changed |
|
||||
| only_changed | `string` | `true` OR `false` | Returns `true` when only files provided using the `files` input have changed. |
|
||||
| any_changed | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has changed (ACMDR) |
|
||||
| only_changed | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input have changed. |
|
||||
| other_changed_files | `string` | `'new.txt path/to/file.png ...'` | Select all modified files <br/> not listed in the files input <br /> i.e. *a combination of all added, <br /> copied and modified files (ACM).* |
|
||||
| all_modified_files | `string` | `'new.txt path/to/file.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 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_files | `string` | `'new.txt path/to/file.png ...'` | Select all paths (\*) <br /> i.e. *a combination of all options below.* |
|
||||
| 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) |
|
||||
@@ -113,11 +113,11 @@ jobs:
|
||||
|
||||
- name: Get changed files using defaults
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v8.7
|
||||
uses: tj-actions/changed-files@v9
|
||||
|
||||
- name: Get changed files using a comma separator
|
||||
id: changed-files-comma
|
||||
uses: tj-actions/changed-files@v8.7
|
||||
uses: tj-actions/changed-files@v9
|
||||
with:
|
||||
separator: ","
|
||||
|
||||
@@ -139,7 +139,7 @@ jobs:
|
||||
|
||||
- name: Get specific changed files
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v8.7
|
||||
uses: tj-actions/changed-files@v9
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
@@ -154,17 +154,22 @@ jobs:
|
||||
if: steps.changed-files-specific.outputs.any_changed == 'true'
|
||||
run: |
|
||||
echo "One or more files listed above has changed."
|
||||
|
||||
- name: Run step if only the files listed above change
|
||||
if: steps.changed-files-specific.outputs.only_changed == 'true'
|
||||
run: |
|
||||
echo "Only files listed above have changed."
|
||||
|
||||
- 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@v8.7
|
||||
uses: tj-actions/changed-files@v9
|
||||
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@v8.7
|
||||
uses: tj-actions/changed-files@v9
|
||||
with:
|
||||
files_from_source_file: |
|
||||
test/changed-files-list.txt
|
||||
@@ -173,13 +178,13 @@ jobs:
|
||||
|
||||
- name: Use a different commit SHA
|
||||
id: changed-files-custom-sha
|
||||
uses: tj-actions/changed-files@v8.7
|
||||
uses: tj-actions/changed-files@v9
|
||||
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@v8.7
|
||||
uses: tj-actions/changed-files@v9
|
||||
with:
|
||||
base_sha: "2096ed0"
|
||||
|
||||
@@ -196,7 +201,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v8.7
|
||||
uses: tj-actions/changed-files@v9
|
||||
|
||||
- name: Pre-commit
|
||||
uses: pre-commit/action@v2.0.0
|
||||
@@ -205,8 +210,6 @@ jobs:
|
||||
token: ${{ secrets.github_token }}
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: Changed files
|
||||
description: Get all changed files
|
||||
description: Get all changed files for push and pull request events.
|
||||
author: tj-actions
|
||||
inputs:
|
||||
token:
|
||||
|
||||
@@ -64,7 +64,7 @@ if [[ -z "$UNIQUE_FILES" ]]; then
|
||||
UNMERGED=$(git diff --diff-filter=U --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//")
|
||||
UNKNOWN=$(git diff --diff-filter=X --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//")
|
||||
ALL_CHANGED=$(git diff --diff-filter="*ACDMRTUX" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//")
|
||||
ALL_MODIFIED_FILES=$(git diff --diff-filter="ACM" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//")
|
||||
ALL_MODIFIED_FILES=$(git diff --diff-filter="ACMDR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//")
|
||||
else
|
||||
ADDED_ARRAY=()
|
||||
COPIED_ARRAY=()
|
||||
@@ -100,7 +100,7 @@ else
|
||||
# shellcheck disable=SC2207
|
||||
ALL_CHANGED_ARRAY+=($(git diff --diff-filter="*ACDMRTUX" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "(${path})" | xargs || true))
|
||||
# shellcheck disable=SC2207
|
||||
ALL_MODIFIED_FILES_ARRAY+=($(git diff --diff-filter="ACM" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "(${path})" | xargs || true))
|
||||
ALL_MODIFIED_FILES_ARRAY+=($(git diff --diff-filter="ACMDR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "(${path})" | xargs || true))
|
||||
done
|
||||
|
||||
# shellcheck disable=SC2001
|
||||
@@ -139,7 +139,7 @@ echo "All modified files: $ALL_MODIFIED_FILES"
|
||||
if [[ -n "$UNIQUE_FILES" ]]; then
|
||||
# shellcheck disable=SC2001
|
||||
ALL_INPUT_FILES=$(echo "$UNIQUE_FILES" | tr "\n" " " | xargs)
|
||||
ALL_OTHER_CHANGED_FILES=$(git diff --diff-filter="ACM" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA")
|
||||
ALL_OTHER_CHANGED_FILES=$(git diff --diff-filter="ACMDR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA")
|
||||
|
||||
OTHER_CHANGED_FILES=$(echo "${ALL_OTHER_CHANGED_FILES[@]}" "${ALL_MODIFIED_FILES[@]}" | tr ' ' '\n' | sort | uniq -u | tr "\n" " " | xargs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user