mirror of
https://github.com/primer/css.git
synced 2025-01-05 04:47:21 +03:00
Combine into one workflow
This commit is contained in:
parent
100cf09024
commit
9c658c0a48
38
.github/workflows/bundle_stats.yml
vendored
38
.github/workflows/bundle_stats.yml
vendored
@ -1,38 +0,0 @@
|
|||||||
name: Bundle stats
|
|
||||||
on: [pull_request]
|
|
||||||
jobs:
|
|
||||||
bundle:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: 14
|
|
||||||
- run: yarn
|
|
||||||
- run: yarn pretest
|
|
||||||
- name: Reporting bundle sizes
|
|
||||||
uses: primer/comment-token-update@main
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
comment-token: 'bundle_table'
|
|
||||||
script: |
|
|
||||||
echo "### Bundle size changes since latest release"
|
|
||||||
echo "```"
|
|
||||||
script/bundle-size-report.js
|
|
||||||
echo "```"
|
|
||||||
|
|
||||||
- name: Reporting selector diffs
|
|
||||||
uses: primer/comment-token-update@main
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
comment-token: 'diff_report'
|
|
||||||
script: |
|
|
||||||
diff=$(script/selector-diff-report)
|
|
||||||
if [[ $diff ]]; then
|
|
||||||
echo "### Selectors added/removed"
|
|
||||||
echo "```diff"
|
|
||||||
echo $diff
|
|
||||||
echo "```"
|
|
||||||
fi
|
|
95
.github/workflows/greetings.yml
vendored
95
.github/workflows/greetings.yml
vendored
@ -1,5 +1,9 @@
|
|||||||
name: Welcome
|
name: Welcome
|
||||||
on: [pull_request]
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
branches-ignore:
|
||||||
|
- 'changeset-release/main'
|
||||||
|
- 'dependabot/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
greetings:
|
greetings:
|
||||||
@ -13,9 +17,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 14.x
|
node-version: 14.x
|
||||||
|
|
||||||
# - name: Install dependencies
|
|
||||||
# run: yarn
|
|
||||||
|
|
||||||
- name: Get or Create Comment
|
- name: Get or Create Comment
|
||||||
uses: actions/github-script@v3
|
uses: actions/github-script@v3
|
||||||
with:
|
with:
|
||||||
@ -37,3 +38,89 @@ jobs:
|
|||||||
body: body.replace('{{PR_AUTHOR}}', context.payload.sender.login)
|
body: body.replace('{{PR_AUTHOR}}', context.payload.sender.login)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bundle-stats:
|
||||||
|
needs: greetings
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 14
|
||||||
|
- run: yarn
|
||||||
|
- run: yarn pretest
|
||||||
|
- name: Reporting bundle sizes
|
||||||
|
uses: primer/comment-token-update@main
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
comment-token: 'bundle_table'
|
||||||
|
script: |
|
||||||
|
echo "### Bundle size changes since latest release"
|
||||||
|
echo "```"
|
||||||
|
script/bundle-size-report.js
|
||||||
|
echo "```"
|
||||||
|
|
||||||
|
- name: Reporting selector diffs
|
||||||
|
uses: primer/comment-token-update@main
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
comment-token: 'diff_report'
|
||||||
|
script: |
|
||||||
|
diff=$(script/selector-diff-report)
|
||||||
|
if [[ $diff ]]; then
|
||||||
|
echo "### Selectors added/removed"
|
||||||
|
echo "```diff"
|
||||||
|
echo $diff
|
||||||
|
echo "```"
|
||||||
|
fi
|
||||||
|
|
||||||
|
label-release:
|
||||||
|
name: Semantic Version Label
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/github-script@v3
|
||||||
|
id: version-result
|
||||||
|
with:
|
||||||
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
result-encoding: string
|
||||||
|
script: |
|
||||||
|
const diff_url = context.payload.pull_request.diff_url
|
||||||
|
const result = await github.request(diff_url)
|
||||||
|
const match = [...result.data.matchAll(/^\+['"]@primer\/css['"]:\s(patch|minor|major)/m)]
|
||||||
|
if (match && match[0]) {
|
||||||
|
return match[0][1]
|
||||||
|
}
|
||||||
|
|
||||||
|
- uses: actions/github-script@v3
|
||||||
|
env:
|
||||||
|
RELEASE: ${{ steps.version-result.outputs.result }}
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
if (process.env.RELEASE == 'undefined') { return }
|
||||||
|
const issue = await github.issues.get({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.issue.number
|
||||||
|
})
|
||||||
|
const currentLabels = issue.data.labels.map( l => l.name)
|
||||||
|
const newLabel = `${process.env.RELEASE} release`
|
||||||
|
if (!currentLabels.includes(newLabel)) {
|
||||||
|
const otherReleaseLabels = currentLabels.filter( l => l.endsWith(' release'))
|
||||||
|
if (otherReleaseLabels.length) {
|
||||||
|
github.issues.removeLabel({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
name: [otherReleaseLabels]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
github.issues.addLabels({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
labels: [newLabel]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
55
.github/workflows/triage.yml
vendored
55
.github/workflows/triage.yml
vendored
@ -1,55 +0,0 @@
|
|||||||
name: Triage
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
branches-ignore:
|
|
||||||
- 'dependabot/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
label-release:
|
|
||||||
name: Semantic Version Label
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/github-script@v3
|
|
||||||
id: version-result
|
|
||||||
with:
|
|
||||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
result-encoding: string
|
|
||||||
script: |
|
|
||||||
const diff_url = context.payload.pull_request.diff_url
|
|
||||||
const result = await github.request(diff_url)
|
|
||||||
const match = [...result.data.matchAll(/^\+['"]@primer\/css['"]:\s(patch|minor|major)/m)]
|
|
||||||
if (match && match[0]) {
|
|
||||||
return match[0][1]
|
|
||||||
}
|
|
||||||
|
|
||||||
- uses: actions/github-script@v3
|
|
||||||
env:
|
|
||||||
RELEASE: ${{ steps.version-result.outputs.result }}
|
|
||||||
with:
|
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
||||||
script: |
|
|
||||||
if (process.env.RELEASE == 'undefined') { return }
|
|
||||||
const issue = await github.issues.get({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.issue.number
|
|
||||||
})
|
|
||||||
const currentLabels = issue.data.labels.map( l => l.name)
|
|
||||||
const newLabel = `${process.env.RELEASE} release`
|
|
||||||
if (!currentLabels.includes(newLabel)) {
|
|
||||||
const otherReleaseLabels = currentLabels.filter( l => l.endsWith(' release'))
|
|
||||||
if (otherReleaseLabels.length) {
|
|
||||||
github.issues.removeLabel({
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
name: [otherReleaseLabels]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
github.issues.addLabels({
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
labels: [newLabel]
|
|
||||||
})
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user