Skip to content

Commit

Permalink
chore: fixed some minor issues in the currency automation scripts (in…
Browse files Browse the repository at this point in the history
  • Loading branch information
nithinputhenveettil authored Sep 24, 2024
1 parent 292440f commit bb08e09
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
6 changes: 1 addition & 5 deletions .tekton/tracer-reports/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ spec:
git config user.email "$GITHUB_ENTERPRISE_USER_EMAIL"
git add automated/currency/go/report.md || true
git commit -m "Updated tracer reports for Team Go : $(date +'%d-%b-%Y %H:%M:%S')" || true
if [ -s output.txt ]; then
echo "Some error occurred!"
else
git push origin @ || true
fi
git push origin @ || true
---
Expand Down
2 changes: 1 addition & 1 deletion currency_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ while IFS= read -r line; do
debug_log "Immediate next version:" "$IMMEDIATE_NEXT_VERSION"
debug_log "Immediate next version date:" "$IMMEDIATE_NEXT_VERSION_DATE"

debug_log "$TARGET_PACKAGE_NAME - $CURRENT_VERSION - $LATEST_VERSION - $IMMEDIATE_NEXT_VERSION" >> $OUTPUT_TO_SLACK
echo "$TARGET_PACKAGE_NAME - $CURRENT_VERSION - $LATEST_VERSION - $IMMEDIATE_NEXT_VERSION" >> $OUTPUT_TO_SLACK

find_days_behind_last_support "$IMMEDIATE_NEXT_VERSION_DATE"

Expand Down
11 changes: 7 additions & 4 deletions version_updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ while IFS= read -r line; do
continue
fi

if gh pr list | grep -q "feat(currency): updated instrumentation of $INSTRUMENTATION for new version $LATEST_VERSION"; then
PR_TITLE="feat(currency): updated instrumentation of $INSTRUMENTATION for new version $LATEST_VERSION"
COMMIT_MSG="feat(currency): updated go.mod, go.sum files, README.md for $INSTRUMENTATION"

if gh pr list | grep -q "$PR_TITLE"; then
echo "PR for $INSTRUMENTATION newer version:$LATEST_VERSION already exists. Skipping to next iteration"
continue
fi
Expand Down Expand Up @@ -162,13 +165,13 @@ while IFS= read -r line; do
git checkout -b "update-instrumentations-$INSTRUMENTATION-id-$CURRENT_TIME_UNIX"

git add go.mod go.sum $LIBRARY_INFO_MD_PATH
git commit -m "feat(currency): updated go.mod, go.sum files, README.md for $INSTRUMENTATION"
git commit -m "$COMMIT_MSG"
git push origin @

# Create a PR request for the changes
# shellcheck disable=SC2046
gh pr create --title "feat(currency): updated instrumentation of $INSTRUMENTATION for new version $LATEST_VERSION. Id: $CURRENT_TIME_UNIX" \
--body "This PR adds changes for the newer version $LATEST_VERSION for the instrumented package" --head $(git branch --show-current)
gh pr create --title "$PR_TITLE. Id: $CURRENT_TIME_UNIX" \
--body "This PR adds changes for the newer version $LATEST_VERSION for the instrumented package" --head $(git branch --show-current) --label "tekton_ci"

# Back to working directry
cd $TRACER_PATH
Expand Down

0 comments on commit bb08e09

Please sign in to comment.