Skip to content

Commit c40bedd

Browse files
committed
Cleanup
1 parent 60561e8 commit c40bedd

File tree

4 files changed

+49
-56
lines changed

4 files changed

+49
-56
lines changed

.github/workflows/bump-packages.yaml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,17 @@ jobs:
1010
name: Bump packages
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/create-github-app-token@v1
13+
- uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
1414
id: app-token
1515
with:
1616
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
1717
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
1818

19-
- name: Get GitHub App User ID
20-
id: get-user-id
21-
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
22-
shell: bash
23-
env:
24-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
25-
26-
- name: Set up Git
27-
run: |
28-
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
29-
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
30-
shell: bash
31-
3219
- uses: actions/checkout@v4
3320
with:
3421
# don't checkout a detatched HEAD
3522
ref: ${{ github.head_ref }}
23+
token: ${{ steps.app-token.outputs.token }}
3624

3725
# this is important so git log can pick up on
3826
# the whole history to generate the list of AUTHORS

.github/workflows/codeql.yml

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ "main" ]
19+
branches: ["main"]
2020
schedule:
21-
- cron: '30 14 * * 4'
21+
- cron: "30 14 * * 4"
2222

2323
jobs:
2424
analyze:
@@ -33,53 +33,53 @@ jobs:
3333
strategy:
3434
fail-fast: false
3535
matrix:
36-
language: [ 'javascript-typescript' ]
36+
language: ["javascript-typescript"]
3737
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
3838
# Use only 'java' to analyze code written in Java, Kotlin or both
3939
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
4040
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
4141

4242
steps:
43-
- name: Checkout repository
44-
uses: actions/checkout@v3
43+
- name: Checkout repository
44+
uses: actions/checkout@v4
4545

46-
# Initializes the CodeQL tools for scanning.
47-
- name: Initialize CodeQL
48-
uses: github/codeql-action/init@v2
49-
with:
50-
languages: ${{ matrix.language }}
51-
# If you wish to specify custom queries, you can do so here or in a config file.
52-
# By default, queries listed here will override any specified in a config file.
53-
# Prefix the list here with "+" to use these queries and those in the config file.
46+
# Initializes the CodeQL tools for scanning.
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/init@v2
49+
with:
50+
languages: ${{ matrix.language }}
51+
# If you wish to specify custom queries, you can do so here or in a config file.
52+
# By default, queries listed here will override any specified in a config file.
53+
# Prefix the list here with "+" to use these queries and those in the config file.
5454

55-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
56-
# queries: security-extended,security-and-quality
57-
config: |
58-
paths-ignore:
59-
- '**/*.test.js'
60-
- '**/*.spec.js'
61-
- '**/*.test.ts'
62-
- '**/*.spec.ts'
63-
- '**/*.test.tsx'
64-
- '**/*.spec.tsx'
65-
- 'scripts/**'
55+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
56+
# queries: security-extended,security-and-quality
57+
config: |
58+
paths-ignore:
59+
- '**/*.test.js'
60+
- '**/*.spec.js'
61+
- '**/*.test.ts'
62+
- '**/*.spec.ts'
63+
- '**/*.test.tsx'
64+
- '**/*.spec.tsx'
65+
- 'scripts/**'
6666
67-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
68-
# If this step fails, then you should remove it and run the build manually (see below)
69-
- name: Autobuild
70-
uses: github/codeql-action/autobuild@v2
67+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
68+
# If this step fails, then you should remove it and run the build manually (see below)
69+
- name: Autobuild
70+
uses: github/codeql-action/autobuild@v2
7171

72-
# ℹ️ Command-line programs to run using the OS shell.
73-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
72+
# ℹ️ Command-line programs to run using the OS shell.
73+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
7474

75-
# If the Autobuild fails above, remove it and uncomment the following three lines.
76-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
75+
# If the Autobuild fails above, remove it and uncomment the following three lines.
76+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
7777

78-
# - run: |
79-
# echo "Run, Build Application using script"
80-
# ./location_of_script_within_repo/buildscript.sh
78+
# - run: |
79+
# echo "Run, Build Application using script"
80+
# ./location_of_script_within_repo/buildscript.sh
8181

82-
- name: Perform CodeQL Analysis
83-
uses: github/codeql-action/analyze@v2
84-
with:
85-
category: "/language:${{matrix.language}}"
82+
- name: Perform CodeQL Analysis
83+
uses: github/codeql-action/analyze@v2
84+
with:
85+
category: "/language:${{matrix.language}}"

.github/workflows/publish-packages.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21-
- uses: actions/create-github-app-token@v1
21+
- uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
2222
id: app-token
2323
with:
2424
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
@@ -28,6 +28,7 @@ jobs:
2828
with:
2929
# don't checkout a detatched HEAD
3030
ref: ${{ github.head_ref }}
31+
token: ${{ steps.app-token.outputs.token }}
3132

3233
# this is important so git log has the whole history
3334
fetch-depth: "0"

.github/workflows/update-cidrs.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jobs:
1818
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
1919

2020
- uses: actions/checkout@v4
21+
with:
22+
# don't checkout a detatched HEAD
23+
ref: ${{ github.head_ref }}
24+
token: ${{ steps.app-token.outputs.token }}
2125

2226
- uses: actions/setup-node@v4
2327
with:
@@ -27,7 +31,7 @@ jobs:
2731
- name: Install Dependencies
2832
run: |
2933
npm -v
30-
npm i
34+
npm ci
3135
# make sure precommit.js is compiled
3236
npm run bootstrap-ci -- --scope @mongodb-js/monorepo-tools --stream --include-dependencies
3337

0 commit comments

Comments
 (0)