Skip to content

Commit

Permalink
Merge branch 'main' into dris0000/sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull authored Aug 22, 2023
2 parents 0dea3a0 + 44da54d commit 00e7d63
Show file tree
Hide file tree
Showing 246 changed files with 20,474 additions and 15,016 deletions.
23 changes: 23 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"dictionaries": [
"calcite-dev",
"css",
"en-common-misspellings",
"fullstack",
"html",
"html-symbol-entities",
"lorem-ipsum",
"markdown",
"node",
"npm",
"shell",
"software-terms",
"typescript"
],
"dictionaryDefinitions": [
{
"name": "calcite-dev",
"path": "./support/dictionaries/dict-calcite-design-system.txt"
}
]
}
26 changes: 26 additions & 0 deletions .github/actions/assignPullRequestAuthor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = async ({ github, context }) => {
const {
assignees,
number,
user: { login: author },
} = context.payload.pull_request;

const updatedAssignees =
assignees && assignees.length
? [...assignees.map((a) => a.login).filter((a) => a !== author), author]
: [author];

try {
await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: number,
assignees: updatedAssignees,
});
} catch (e) {
console.error(
"Unable to assign the PR author, they likely do not have write permissions\n",
e,
);
}
};
52 changes: 52 additions & 0 deletions .github/actions/labelPullRequestWithCommitType.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
module.exports = async ({ github, context }) => {
const { title, number } = context.payload.pull_request;

const conventionalCommitRegex =
/^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([\w ,-]+\))?(!?:\s+)([\w ]+[\s\S]*)/i;

if (!title) {
console.log("No title found, ending run.");
return;
}

const match = title.match(conventionalCommitRegex);

if (!match || match.length < 2) {
console.log("Title does not match conventional commit regex, ending run.");
return;
}

// commit type is in the first match group
const typeLabel = getLabelName(match[1]);

try {
await github.rest.issues.addLabels({
issue_number: number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [typeLabel],
});
} catch (e) {
console.error("Unable to label pull request, the author likely does not have write permissions\n", e);
}
};

function getLabelName(type) {
switch (type) {
case "feat":
return "enhancement";
case "fix":
return "bug";
case "docs":
return "docs";
case "test":
return "testing";
case "refactor":
return "refactor";
case "tooling":
return "tooling";
default:
return "chore";
}
}

2 changes: 1 addition & 1 deletion .github/workflows/deploy-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: package.json
node-version: 16
registry-url: "https://registry.npmjs.org"
- name: Build Packages and Publish to NPM
if: ${{ steps.release.outputs.releases_created }}
Expand Down
67 changes: 9 additions & 58 deletions .github/workflows/pr-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,27 @@ name: PR Bot
on:
pull_request:
branches: [main]
permissions:
pull-requests: write
issues: write
jobs:
assign-author:
if: github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.user.login != 'renovate[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/github-script@v6
with:
script: |
const {
assignees,
number,
user: { login: author },
} = context.payload.pull_request;
const updatedAssignees =
assignees && assignees.length
? [...assignees.map((a) => a.login).filter(a => a !== author), author]
: [author];
await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: number,
assignees: updatedAssignees,
});
const action = require('${{ github.workspace }}/.github/actions/assignPullRequestAuthor.js')
await action({github, context})
label-type:
if: github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.user.login != 'renovate[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/github-script@v6
with:
script: |
const { title, number } = context.payload.pull_request;
const conventionalCommitRegex =
/^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([\w ,-]+\))?(!?:\s+)([\w ]+[\s\S]*)/i;
if (!title) {
console.log("No title found, ending run.");
return;
}
const match = title.match(conventionalCommitRegex);
if (match && match.length > 1) {
// commit type is in the first match group
const typeLabel = getLabelName(match[1]);
await github.rest.issues.addLabels({
issue_number: number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [typeLabel],
});
function getLabelName(type) {
switch (type) {
case "feat":
return "enhancement";
case "fix":
return "bug";
case "docs":
return "docs";
case "test":
return "testing";
case "refactor":
return "refactor";
case "tooling":
return "tooling";
default:
return "chore";
}
}
}
const action = require('${{ github.workspace }}/.github/actions/labelPullRequestWithCommitType.js')
await action({github, context})
4 changes: 2 additions & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packages/calcite-components": "1.5.1",
"packages/calcite-components-react": "1.5.1",
"packages/calcite-components": "1.6.1",
"packages/calcite-components-react": "1.6.1",
"packages/eslint-plugin-calcite-components": "0.2.2"
}
Loading

0 comments on commit 00e7d63

Please sign in to comment.