Bump peter-evans/create-pull-request from 6.1.0 to 7.0.0 #42
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2023 Chainguard, Inc. | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Test | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Run Digestabot | |
uses: ./ | |
with: | |
create-pr: false | |
- name: Check changes | |
run: | | |
if [[ $(git diff --stat) == '' ]]; then | |
echo 'should exist changes' | |
exit 1 | |
else | |
exit 0 | |
fi | |
shell: bash | |
test-working-dir: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Run Digestabot | |
uses: ./ | |
with: | |
create-pr: false | |
working-dir: './testfiles/test-dir' | |
- name: Check changes | |
shell: bash | |
run: | | |
file_to_check='testfiles/test-dir/k8s-job-2.yaml' | |
modified_files=$(git diff --name-only && git diff --cached --name-only) | |
# Remove any duplicate entries from the list of modified files | |
modified_files=$(echo "$modified_files" | sort | uniq) | |
# Check if only the specified file is in the list of modified files | |
if [ "$modified_files" == "$file_to_check" ]; then | |
echo "Only $file_to_check has been modified" | |
exit 0 | |
else | |
echo "Other files have been modified or there are no changes" | |
exit 1 | |
fi |