Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ spec:
script: |
cd cloned
git status -s --porcelain | cut -c4- > ../updated_files.txt
# Check if ../updated_files.txt is empty or not
if [ -s ../updated_files.txt ]; then
echo -e "Script has modified files:\n$(cat ../updated_files.txt)"
else
echo "No modified files after running the script, exiting..."
exit 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When can the "No modified files after running the script" situation happen? Is it an error or can it happen in normal conditions?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Technically, since the script is a param, I guess normal conditions. But based on our typical usage?)

@tisutisu tisutisu Jan 10, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It an error condition, like when we updated the script here since the infra-deployement repo PR is yet to merge, which will have the yaml files updated by task.. so in push pipeline of build-service PR, it didnot produce any changed file in ../updated_files.txt and in result of that the following steps of the task closed the existing open PR which tries to open a PR by resetting the branch

fi

# Based on https://github.com/tektoncd/catalog/tree/main/task/github-app-token/0.2/
- name: create-mr
image: quay.io/redhat-appstudio/github-app-token@sha256:b4f2af12e9beea68055995ccdbdb86cfe1be97688c618117e5da2243dc1da18e
Expand Down