-
Notifications
You must be signed in to change notification settings - Fork 237
chore(ci): update dependencies without force push COMPASS-9939 #7445
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -44,6 +44,8 @@ jobs: | |||||||||||||||||||||||||||||
name: Update ${{ matrix.group_name }} to latest | ||||||||||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||
needs: configure_matrix | ||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||
UPDATE_BRANCH_NAME: ci/update-${{ matrix.group_name }} | ||||||||||||||||||||||||||||||
strategy: | ||||||||||||||||||||||||||||||
matrix: | ||||||||||||||||||||||||||||||
group_name: ${{ fromJSON(needs.configure_matrix.outputs.group_name) }} | ||||||||||||||||||||||||||||||
|
@@ -77,12 +79,36 @@ jobs: | |||||||||||||||||||||||||||||
- name: Run "update dependencies" script | ||||||||||||||||||||||||||||||
run: npx compass-scripts update-dependencies preset-${{ matrix.group_name }} | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
# Conditionally performing a sparse checkout of the existing branch to compare changes | ||||||||||||||||||||||||||||||
# and avoid the "create-pull-request" action force-pushing when changes aren't necessary. | ||||||||||||||||||||||||||||||
# This also allows us pushing commits to the update branch to fix any breaking changes | ||||||||||||||||||||||||||||||
# without risking these commits being overwritten by the action. | ||||||||||||||||||||||||||||||
- name: Check existence of an existing branch | ||||||||||||||||||||||||||||||
id: check-branch-exists | ||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||
if git ls-remote --exit-code --heads origin ${{ env.UPDATE_BRANCH_NAME }}; then | ||||||||||||||||||||||||||||||
echo "branch_exists=true" >> "$GITHUB_OUTPUT" | ||||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||||
echo "branch_exists=false" >> "$GITHUB_OUTPUT" | ||||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
- name: Checkout existing branch | ||||||||||||||||||||||||||||||
if: steps.check-branch-exists.outputs.branch_exists == 'true' | ||||||||||||||||||||||||||||||
uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||
ref: ${{ env.UPDATE_BRANCH_NAME }} | ||||||||||||||||||||||||||||||
path: existing-branch-checkout | ||||||||||||||||||||||||||||||
sparse-checkout: | | ||||||||||||||||||||||||||||||
package-lock.json | ||||||||||||||||||||||||||||||
sparse-checkout-cone-mode: false | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
- name: Create Pull Request | ||||||||||||||||||||||||||||||
if: steps.check-branch-exists.outputs.branch_exists == 'false' || hashFiles('package-lock.json') != hashFiles('existing-branch-checkout/package-lock.json') | ||||||||||||||||||||||||||||||
Comment on lines
80
to
+106
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5 | ||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||
token: ${{ steps.app-token.outputs.token }} | ||||||||||||||||||||||||||||||
commit-message: 'chore(deps): update ${{ matrix.group_name }} to latest' | ||||||||||||||||||||||||||||||
branch: ci/update-${{ matrix.group_name }} | ||||||||||||||||||||||||||||||
branch: ${{ env.UPDATE_BRANCH_NAME }} | ||||||||||||||||||||||||||||||
title: 'chore(deps): update ${{ matrix.group_name }} to latest' | ||||||||||||||||||||||||||||||
labels: | | ||||||||||||||||||||||||||||||
no-title-validation | ||||||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit hard to validate until we actually manage to make this task update an exiting PR, but just reading through this change seems like this checked out file will continue to be there if the PR is being
createdupdated and I think thecreate-pull-request
will commit it with other files. We probably want to clean it up before this happens?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Perhaps we should just add it to the
.gitignore
?