Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/scripts/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ module.exports = Object.freeze({
/** @type {string} */
"PR_IS_MERGED": process.env.PR_IS_MERGED || "false",

/** @type {string} */
"PR_LABELS": process.env.PR_LABELS || "",

/** @type {string} */
"LABEL_BLOCK": "do-not-merge",

Expand Down
5 changes: 2 additions & 3 deletions .github/scripts/label_pr_based_on_title.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { PR_NUMBER, PR_TITLE } = require("./constants")
const { PR_NUMBER, PR_TITLE, PR_LABELS } = require("./constants")

module.exports = async ({github, context, core}) => {
const FEAT_REGEX = /feat(\((.+)\))?(:.+)/
Expand All @@ -18,10 +18,9 @@ module.exports = async ({github, context, core}) => {
}

// get PR labels from env
const prLabels = process.env.PR_LABELS.replaceAll("\"", "").split(",");
const prLabels = PR_LABELS.replaceAll("\"", "").split(",");
const labelKeys = Object.keys(labels);

// Maintenance: We should keep track of modified PRs in case their titles change
let miss = 0;
try {
for (const label in labels) {
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/label_pr_on_title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
env:
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
PR_TITLE: ${{ needs.get_pr_details.outputs.prTitle }}
PR_LABELS: ${{ needs.get_pr_details.outputs.prLabels }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# This safely runs in our base repo, not on fork
Expand Down