-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
287 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
.github/workflows/github-actions-enforce-change-type-label.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Change Type label verification | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, labeled, unlabeled, synchronize] | ||
|
||
jobs: | ||
check-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Require exactly one change type label | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const allChangeTypeLabels = new Set([ | ||
'change type - cosmetic 🌹', | ||
'change type - documentation - docs team 📝', | ||
'change type - documentation - member 📝', | ||
'change type - major 🚨', | ||
'change type - minor 🤏', | ||
]); | ||
const prLabels = context.payload.pull_request.labels.map(label => label.name); | ||
const appliedChangeTypeLabels = prLabels.filter(prLabel => allChangeTypeLabels.has(prLabel)); | ||
if (appliedChangeTypeLabels.length !== 1) { | ||
const baseMessage = `The PR must have EXACTLY one of the following CHANGE TYPE labels: ${Array.from(allChangeTypeLabels).sort().join(', ')}. ` | ||
const n = appliedChangeTypeLabels.length; | ||
let contextualMessage; | ||
if (n === 0) { | ||
contextualMessage = 'It currently has no change type label. Please ➕ add one label. 🙏' | ||
} else { | ||
contextualMessage = `It currently has ${n} change type labels (${JSON.stringify(appliedChangeTypeLabels)}). 🙏 Please ❌ remove ${n-1} label(s).` | ||
} | ||
core.setFailed(baseMessage + contextualMessage); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Addresses | ||
title: Addresses schema concepts | ||
draft: true | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Divisions | ||
title: Divisions schema concepts | ||
draft: true | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.