Skip to content

Commit c1bf2c9

Browse files
authored
Reenable danger in CI (DefinitelyTyped#74450)
1 parent 4f5c19f commit c1bf2c9

File tree

3 files changed

+38
-38
lines changed

3 files changed

+38
-38
lines changed

.github/workflows/CI.yml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -124,38 +124,38 @@ jobs:
124124
retention-days: 1
125125
if: ${{ github.event_name == 'pull_request' }}
126126

127-
# dangerbot:
128-
# runs-on: ubuntu-latest
129-
# if: github.repository == 'DefinitelyTyped/DefinitelyTyped' && github.event_name == 'pull_request'
130-
131-
# needs:
132-
# - test
133-
134-
# steps:
135-
# - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
136-
# - uses: ./.github/actions/setup-for-scripts
137-
138-
# - name: Get suggestions dir
139-
# id: suggestions-dir
140-
# run: echo "path=$(node ./scripts/get-suggestions-dir.js)" >> "$GITHUB_OUTPUT"
141-
142-
# - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
143-
# with:
144-
# path: ${{ steps.suggestions-dir.outputs.path }}
145-
# merge-multiple: true
146-
147-
# - name: 'Run Danger'
148-
# env:
149-
# # See https://github.com/danger/danger-js/issues/1042
150-
# DANGER_GITHUB_API_BASE_URL: 'https://api.github.com'
151-
152-
# # Danger failing (for example through rate-limiting) shouldn't fail the build
153-
# run: |
154-
# # Exposing this token is safe because the user of it has no other public repositories
155-
# # and has no permission to modify this repository. See #62638 for the discussion.
156-
# TOKEN='ghp_i5wtj1l2AbpFv3OU96w6R'
157-
# TOKEN+='On3bHOkcV2AmVY6'
158-
# DANGER_GITHUB_API_TOKEN=$TOKEN pnpm danger ci || $( exit 0 )
127+
dangerbot:
128+
runs-on: ubuntu-latest
129+
if: github.repository == 'DefinitelyTyped/DefinitelyTyped' && github.event_name == 'pull_request'
130+
131+
needs:
132+
- test
133+
134+
steps:
135+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
136+
- uses: ./.github/actions/setup-for-scripts
137+
138+
- name: Get suggestions dir
139+
id: suggestions-dir
140+
run: echo "path=$(node ./scripts/get-suggestions-dir.js)" >> "$GITHUB_OUTPUT"
141+
142+
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
143+
with:
144+
path: ${{ steps.suggestions-dir.outputs.path }}
145+
merge-multiple: true
146+
147+
- name: 'Run Danger'
148+
env:
149+
# See https://github.com/danger/danger-js/issues/1042
150+
DANGER_GITHUB_API_BASE_URL: 'https://api.github.com'
151+
152+
# Danger failing (for example through rate-limiting) shouldn't fail the build
153+
run: |
154+
# Exposing this token is safe because the user of it has no other public repositories
155+
# and has no permission to modify this repository. See #62638 for the discussion.
156+
TOKEN='ghp_i5wtj1l2AbpFv3OU96w6R'
157+
TOKEN+='On3bHOkcV2AmVY6'
158+
DANGER_GITHUB_API_TOKEN=$TOKEN pnpm danger ci || $( exit 0 )
159159
160160
scripts:
161161
runs-on: ubuntu-latest

dangerfile.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import fs = require("fs");
2-
import os = require("os");
3-
import path = require("path");
4-
import cp = require("child_process");
51
import { mangleScopedPackage, suggestionsDir } from "@definitelytyped/utils";
62
import { danger, fail, markdown } from "danger";
3+
import cp from "node:child_process";
4+
import fs from "node:fs";
5+
import os from "node:os";
6+
import path from "node:path";
77
const lines: string[] = [];
88
const missingProperty = /module exports a property named '(.+?)', which is missing/;
99

@@ -129,7 +129,7 @@ if (dprintErrors.length > 0) {
129129
"## Formatting errors",
130130
"",
131131
codeBlock,
132-
...dprintErrors.join("\n\n"),
132+
dprintErrors.join("\n\n"),
133133
codeBlock,
134134
];
135135

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@definitelytyped/header-parser": "latest",
3838
"@definitelytyped/typescript-versions": "latest",
3939
"@definitelytyped/utils": "latest",
40-
"danger": "^11.2.3",
40+
"danger": "^13.0.5",
4141
"dprint": "^0.49.0",
4242
"eslint-plugin-jsdoc": "^44.2.7",
4343
"husky": "^8.0.3",

0 commit comments

Comments
 (0)