Skip to content

Commit 7397e9d

Browse files
committed
feat(github-actions): create a github action to automatically apply and remove breaking changes label (angular#138)
Automatically apply and remove breaking changes label based on the presence of a commit containing a breaking change. Closes angular#127 PR Close angular#138
1 parent 4a38979 commit 7397e9d

File tree

9 files changed

+30519
-5
lines changed

9 files changed

+30519
-5
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: DevInfra
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
breaking_changes_label:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: ./github-actions/breaking-changes-auto-labeling
13+
with:
14+
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
github-actions/feature-request/bundle.js
22
github-actions/lock-closed/bundle.js
3+
github-actions/breaking-changes-label/bundle.js

github-actions/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ package(default_visibility = ["//github-actions:__subpackages__"])
55
ts_library(
66
name = "utils",
77
srcs = [
8-
"utils.ts",
8+
"utils.ts",
99
],
1010
deps = [
1111
"@npm//@actions/core",
12-
"@npm//github-app-installation-token",
1312
"@npm//@types/node",
13+
"@npm//github-app-installation-token",
1414
],
1515
)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
load("//tools:defaults.bzl", "esbuild_checked_in", "ts_library")
2+
3+
package(default_visibility = ["//github-actions/feature-request:__subpackages__"])
4+
5+
ts_library(
6+
name = "breakings-changes-auto-labeling",
7+
srcs = glob(
8+
["*.ts"],
9+
exclude = ["*.spec.ts"],
10+
),
11+
deps = [
12+
"//github-actions:utils",
13+
"//ng-dev/commit-message",
14+
"@npm//@actions/core",
15+
"@npm//@actions/github",
16+
"@npm//@octokit/rest",
17+
"@npm//@types/node",
18+
],
19+
)
20+
21+
esbuild_checked_in(
22+
name = "bundle",
23+
entry_point = "main.ts",
24+
deps = [
25+
":breakings-changes-auto-labeling",
26+
],
27+
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: 'Breaking Changes Labeling'
2+
description: 'Automatically label pull requests with a breaking change with a breaking change label'
3+
author: 'Angular'
4+
inputs:
5+
angular-robot-key:
6+
description: 'The private key for the Angular Robot Github app.'
7+
required: true
8+
runs:
9+
using: 'node12'
10+
main: 'bundle.js'

0 commit comments

Comments
 (0)