Skip to content

Commit 07b3102

Browse files
kodster28sdnts
authored andcommitted
[Chore] Rationalize GHA as part of 'how we docs' exercise (cloudflare#23761)
1 parent da7f36b commit 07b3102

File tree

10 files changed

+44
-47
lines changed

10 files changed

+44
-47
lines changed

.github/actions/assign-issue/index.ts renamed to .github/actions/issue-label-assign/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ import * as codeOwnersUtils from "codeowners-utils";
8484

8585
console.log("Assignees added (if present)");
8686

87-
// Add labels for future reporting
87+
// Add "product" labels
8888

8989
const labelPrefix = "product:";
9090
const newLabels = new Set<string>();

.github/actions/assign-issue/package-lock.json renamed to .github/actions/issue-label-assign/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/assign-issue/package.json renamed to .github/actions/issue-label-assign/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"version": "0.0.0",
4-
"name": "assign-issue",
4+
"name": "issue-label-assign",
55
"scripts": {
66
"build": "esbuild index.ts --bundle --format=cjs --platform=node --minify --outfile=index.js"
77
},
File renamed without changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Issue - Label and assign
2+
3+
# **What it does**: Labels Issues with associated products. Updates assignees to match our CODEOWNERS file.
4+
# **Why we have it**: Easier scanning of repo PRs && backend reporting on our team's work.
5+
# **Who does it impact**: PCX team
6+
7+
on:
8+
issues:
9+
types: [opened]
10+
11+
jobs:
12+
compile:
13+
name: Label and assign
14+
permissions:
15+
issues: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: ./.github/actions/issue-label-assign
20+
with:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/issue.yml

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

.github/workflows/label-pr.yml renamed to .github/workflows/pr-label-assign.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
name: Label PRs
1+
name: PR - Label and assign
22

3-
# **What it does**: Uses the files to label PRs with updated doc areas && size estimates.
3+
# **What it does**: Labels PRs with size and associated products. Updates assignees to match our CODEOWNERS file.
44
# **Why we have it**: Easier scanning of repo PRs && backend reporting on our team's work.
55
# **Who does it impact**: PCX team
66

7-
on: [pull_request_target]
7+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
8+
on:
9+
pull_request_target:
10+
types: [opened, reopened]
811

912
concurrency:
1013
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -36,3 +39,16 @@ jobs:
3639
with:
3740
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3841
continue-on-error: true
42+
43+
assign:
44+
name: Update assignees
45+
runs-on: ubuntu-latest
46+
permissions:
47+
issues: write
48+
pull-requests: write
49+
steps:
50+
- uses: actions/checkout@v4
51+
- uses: ./.github/actions/assign-pr
52+
with:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
continue-on-error: true

.github/workflows/pr.yml

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

0 commit comments

Comments
 (0)