Skip to content

Commit

Permalink
Ignore deletions on kustomize action when using filter=modified
Browse files Browse the repository at this point in the history
  • Loading branch information
hpedrorodrigues committed Mar 12, 2024
1 parent 3bc9dfc commit c001b95
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions envsubst/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Simple wrapper action for running [envsubst] over a file or set of files.
## Usage

```yaml
- uses: hpedrorodrigues/actions/envsubst@main
- uses: hpedrorodrigues/actions/envsubst@v1.0.1
with:
# One or more files to apply substitutions on (separated by space).
input: ""
Expand Down Expand Up @@ -35,7 +35,7 @@ Simple wrapper action for running [envsubst] over a file or set of files.
### Apply substitutions on a single file
```yaml
- uses: hpedrorodrigues/actions/envsubst@main
- uses: hpedrorodrigues/actions/envsubst@v1.0.1
with:
input: template.yml
output: deployment.yml
Expand All @@ -44,7 +44,7 @@ Simple wrapper action for running [envsubst] over a file or set of files.
### Apply substitutions on multiple files
```yaml
- uses: hpedrorodrigues/actions/envsubst@main
- uses: hpedrorodrigues/actions/envsubst@v1.0.1
with:
input: template.yml package.txt config.toml
output: result.yml output.txt result.toml
Expand All @@ -53,7 +53,7 @@ Simple wrapper action for running [envsubst] over a file or set of files.
### Apply substitutions in-place
```yaml
- uses: hpedrorodrigues/actions/envsubst@main
- uses: hpedrorodrigues/actions/envsubst@v1.0.1
with:
input: deployment.yml
in_place: true
Expand All @@ -62,7 +62,7 @@ Simple wrapper action for running [envsubst] over a file or set of files.
### Apply substitutions with custom environment variables
```yaml
- uses: hpedrorodrigues/actions/envsubst@main
- uses: hpedrorodrigues/actions/envsubst@v1.0.1
with:
input: template.yml
output: result.yml
Expand All @@ -74,15 +74,15 @@ Simple wrapper action for running [envsubst] over a file or set of files.
### Apply substitutions and print result to stdout
```yaml
- uses: hpedrorodrigues/actions/envsubst@main
- uses: hpedrorodrigues/actions/envsubst@v1.0.1
with:
input: template.yml
```
### Apply substitutions restricting to specific environment variables
```yaml
- uses: hpedrorodrigues/actions/envsubst@main
- uses: hpedrorodrigues/actions/envsubst@v1.0.1
with:
input: template.yml
format: '${CUSTOM_VAR} ${GITHUB_SHA}'
Expand Down
16 changes: 8 additions & 8 deletions kustomize/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Simple action to validate kustomization files and outputs using [Kustomize].
## Usage

```yaml
- uses: hpedrorodrigues/actions/kustomize@main
- uses: hpedrorodrigues/actions/kustomize@v1.0.1
with:
# Strategy to use for detecting kustomization directories.
# Possible values
Expand Down Expand Up @@ -40,9 +40,9 @@ Simple action to validate kustomization files and outputs using [Kustomize].
### Validate all kustomization directories
```yaml
- uses: hpedrorodrigues/actions/kustomize@main
- uses: hpedrorodrigues/actions/kustomize@v1.0.1
# or
- uses: hpedrorodrigues/actions/kustomize@main
- uses: hpedrorodrigues/actions/kustomize@v1.0.1
with:
filter: 'none'
```
Expand All @@ -53,15 +53,15 @@ Simple action to validate kustomization files and outputs using [Kustomize].
- uses: actions/checkout@v4
with:
fetch-depth: 0 # This is required to allow this action to detect modified files.
- uses: hpedrorodrigues/actions/kustomize@main
- uses: hpedrorodrigues/actions/kustomize@v1.0.1
with:
filter: 'modified'
```
### Validate specific kustomization directories
```yaml
- uses: hpedrorodrigues/actions/kustomize@main
- uses: hpedrorodrigues/actions/kustomize@v1.0.1
with:
filter: 'static'
path: 'kustomize/base kustomize/overlays/production'
Expand All @@ -70,7 +70,7 @@ Simple action to validate kustomization files and outputs using [Kustomize].
### Validate kustomization directories with custom log level
```yaml
- uses: hpedrorodrigues/actions/kustomize@main
- uses: hpedrorodrigues/actions/kustomize@v1.0.1
with:
filter: 'none'
log_level: 'verbose'
Expand All @@ -79,7 +79,7 @@ Simple action to validate kustomization files and outputs using [Kustomize].
### Validate kustomization directories with custom flags
```yaml
- uses: hpedrorodrigues/actions/kustomize@main
- uses: hpedrorodrigues/actions/kustomize@v1.0.1
with:
filter: 'none'
flags: '--load-restrictor=LoadRestrictionsNone --enable-alpha-plugins'
Expand All @@ -92,7 +92,7 @@ Simple action to validate kustomization files and outputs using [Kustomize].
- uses: alexellis/arkade-get@master
with:
kustomize: latest
- uses: hpedrorodrigues/actions/kustomize@main
- uses: hpedrorodrigues/actions/kustomize@v1.0.1
with:
filter: 'none'
```
Expand Down
2 changes: 1 addition & 1 deletion kustomize/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ case "${filter}" in
;;
modified)
readonly kustomization_directories="$(
git diff --name-only HEAD^ \
git diff --diff-filter=d --name-only HEAD^ \
| xargs -I {} dirname {} \
| sort -u \
| xargs -I {} sh -c 'find {} -maxdepth 1 \( -name kustomization.yml -o -name kustomization.yaml \) | grep -q . && echo {} || true'
Expand Down

0 comments on commit c001b95

Please sign in to comment.