Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Improve listing changed files in a commit" #1694

Merged
merged 1 commit into from
Dec 5, 2024
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
11 changes: 1 addition & 10 deletions .tekton/scripts/build-acceptable-bundles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ set -o pipefail
DATA_BUNDLE_REPO="${DATA_BUNDLE_REPO:-quay.io/konflux-ci/tekton-catalog/data-acceptable-bundles}"
mapfile -t BUNDLES < <(cat "$@")

pr_number=$(gh search prs --repo konflux-ci/build-definitions --merged "${REVISION}" --json number --jq '.[].number')

# changed files in a PR
mapfile -t changed_files < <(gh pr view "https://github.com/konflux-ci/build-definitions/pull/${pr_number}" --json files --jq '.files.[].path')
# store a list of changed task files
task_records=()
# loop over all changed files
for path in "${changed_files[@]}"; do
for path in $(git log -m -1 --name-only --pretty="format:" "${REVISION}"); do
# check that the file modified is the task file
if [[ "${path}" == task/*/*/*.yaml ]]; then
IFS='/' read -r -a path_array <<< "${path}"
Expand All @@ -34,11 +30,6 @@ printf '%s\n' "${task_records[@]}"
echo "Bundles to be added:"
printf '%s\n' "${BUNDLES[@]}"

if [[ -z ${task_records[*]} && -z ${BUNDLES[*]} ]]; then
echo Nothing to do...
exit 0
fi

# The OPA data bundle is tagged with the current timestamp. This has two main
# advantages. First, it prevents the image from accidentally not having any tags,
# and getting garbage collected. Second, it helps us create a timeline of the
Expand Down
Loading