Skip to content

Commit 3fea2c3

Browse files
Merge remote-tracking branch 'origin/main' into beta-releases
2 parents f52257d + 196186e commit 3fea2c3

File tree

181 files changed

+17249
-6025
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+17249
-6025
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Update dependencies
2+
3+
# Runs nightly and manually
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
group_name:
8+
description: 'Package group to update'
9+
type: choice
10+
default: 'all'
11+
options:
12+
- electron
13+
- eslint
14+
- typescript
15+
- mongosh
16+
- all
17+
required: true
18+
schedule:
19+
- cron: '0 0 * * *'
20+
21+
permissions:
22+
contents: none # We use the github app token to push the changes
23+
24+
jobs:
25+
configure_matrix:
26+
name: Configure matrix
27+
runs-on: ubuntu-latest
28+
outputs:
29+
group_name: ${{ steps.define_groups.outputs.group_name }}
30+
steps:
31+
- id: define_groups
32+
name: Define groups to update
33+
env:
34+
SHOULD_INCLUDE_ALL_GROUPS: ${{ inputs.group_name == '' || inputs.group_name == 'all' }}
35+
run: |
36+
echo "Configuring matrix (inputs.group_name=${{ inputs.group_name }})"
37+
if [[ "$SHOULD_INCLUDE_ALL_GROUPS" = "true" ]]; then
38+
# When adding new group, don't forget to update the `workflow_dispatch`
39+
echo 'group_name=["electron","eslint","typescript","mongosh"]' >> "$GITHUB_OUTPUT"
40+
else
41+
echo 'group_name=["${{ inputs.group_name }}"]' >> "$GITHUB_OUTPUT"
42+
fi
43+
update_dependencies_group:
44+
name: Update ${{ matrix.group_name }} to latest
45+
runs-on: ubuntu-latest
46+
needs: configure_matrix
47+
strategy:
48+
matrix:
49+
group_name: ${{ fromJSON(needs.configure_matrix.outputs.group_name) }}
50+
steps:
51+
- name: Create Github App Token
52+
uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
53+
id: app-token
54+
with:
55+
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
56+
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
57+
58+
- uses: actions/checkout@v4
59+
with:
60+
# don't checkout a detatched HEAD
61+
ref: ${{ github.head_ref || github.ref_name }}
62+
token: ${{ steps.app-token.outputs.token }}
63+
64+
- uses: actions/setup-node@v4
65+
with:
66+
node-version: 22.15.1
67+
cache: 'npm'
68+
69+
- name: Install [email protected]
70+
run: |
71+
npm install -g [email protected]
72+
73+
- name: Install dependencies
74+
run: |
75+
npm ci
76+
77+
- name: Run "update dependencies" script
78+
run: npx compass-scripts update-dependencies preset-${{ matrix.group_name }}
79+
80+
- name: Create Pull Request
81+
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5
82+
with:
83+
token: ${{ steps.app-token.outputs.token }}
84+
commit-message: 'chore(deps): update ${{ matrix.group_name }} to latest'
85+
branch: ci/update-${{ matrix.group_name }}
86+
title: 'chore(deps): update ${{ matrix.group_name }} to latest'
87+
labels: no-title-validation
88+
author: '${{ steps.app-token.outputs.app-slug}}[bot] <${{ steps.app-token.outputs.app-email }}>'
89+
body: |
90+
<p>This PR is automatically generated and updates the versions of
91+
the dependency group ${{ matrix.group_name }} to latest version.</p>
92+
93+
<p>If CI is green on this patch you should feel free to merge it at
94+
your convenience.</p>
95+
96+
<p>If CI is red and you think that failures are related to the
97+
version updates, you should raise an issue, so that it can be
98+
manually resolved and we can continue to update the package group to
99+
latest.</p>

.github/workflows/update-electron.yaml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/update-eslint.yaml

Lines changed: 0 additions & 56 deletions
This file was deleted.

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,4 @@ Jimmy Choi <[email protected]>
111111
112112
Nataly Carbonell <[email protected]>
113113
DarshanaVenkatesh <[email protected]>
114+
Kevin Pamaran <[email protected]>

0 commit comments

Comments
 (0)