在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:pascalgn/size-label-action开源软件地址:https://github.com/pascalgn/size-label-action开源编程语言:JavaScript 100.0%开源软件介绍:size-label-actionGitHub action to assign labels based on pull request change sizes. Labels are taken from https://github.com/kubernetes/kubernetes/labels?q=size UsageCreate a name: size-label
on: pull_request
jobs:
size-label:
runs-on: ubuntu-latest
steps:
- name: size-label
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" Create the needed labelsExport both for size in XL XXL XS S M L; do
curl -sf -H "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/kubernetes/kubernetes/labels/size/$size" |
jq '. | { "name": .name, "color": .color, "description": .description }' |
curl -sfXPOST -d @- -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$REPO/labels
done ConfigurationThe following environment variables are supported:
You can configure the environment variables in the workflow file like this: env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
IGNORED: ".*\n!.gitignore\nyarn.lock\ngenerated/**" Custom sizesThe default sizes are: {
"0": "XS",
"10": "S",
"30": "M",
"100": "L",
"500": "XL",
"1000": "XXL"
} You can pass your own configuration by passing name: size-label
on: pull_request
jobs:
size-label:
runs-on: ubuntu-latest
steps:
- name: size-label
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
sizes: >
{
"0": "XS",
"20": "S",
"50": "M",
"200": "L",
"800": "XL",
"2000": "XXL"
} License |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论