Skip to content

Commit

Permalink
feat:checkcode
Browse files Browse the repository at this point in the history
  • Loading branch information
wybieshang committed Mar 1, 2024
2 parents 0700338 + 266d222 commit f15fbe1
Show file tree
Hide file tree
Showing 58 changed files with 40,895 additions and 804 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/comment-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Generate Commit on Comment with Pull Request

on:
issue_comment:
types: [created]

permissions:
pull-requests: write
contents: write
issues: write

jobs:
generate-commit:
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/generate-commit')
runs-on: ubuntu-latest

steps:
# - name: Get branch name
# id: branch_name
# run: |
# branch_name=$(curl -s -H "Authorization: token ${{ github.token }}" ${{github.event.issue.pull_request.url}} | jq -r '.head.ref')
# echo $branch_name
- name: Checkout
uses: actions/checkout/@v3
with:
fetch-depth: 0
- name: Add comment with workflow run link
run: |
COMMENT_BODY="The workflow run can be found at $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
curl -d '{"body":"'"$COMMENT_BODY"'"}' -H "Content-Type: application/json" -H "Authorization: Bearer ${{github.token}}" -X POST "https://api.github.com/repos/$GITHUB_REPOSITORY/issues/${{ github.event.issue.number }}/comments"
env:
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}

- name: Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
branch_name=$(curl -s -H "Authorization: token ${{ github.token }}" ${{github.event.issue.pull_request.url}} | jq -r '.head.ref')
git checkout -b $branch_name origin/$branch_name
env:
GITHUB_TOKEN: ${{ github.token}}

- name: Setup Nodejs
uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: 16

- name: Install yarn
run: npm install -g yarn@v1

- name: Install Dep
run: |
yarn install --frozen-lockfile
- name: Update Pull Request
run: |
yarn changelog:comment
env:
GITHUB_TOKEN: ${{ github.token}}
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
56 changes: 56 additions & 0 deletions .github/workflows/update-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Update Pull Request Body

on:
pull_request:
branches: main

permissions:
pull-requests: write

jobs:
update-pr:
runs-on: ubuntu-latest

steps:
- name: Check if commit is from CI
run: |
if [[ "${{ github.event.head_commit.committer.username }}" == "github-actions[bot]" ]]; then
echo "Commit is from CI, skipping the build..."
exit 78
else
echo "Commit is not from CI, continuing with the build..."
fi
- name: Checkout
uses: actions/checkout/@v3
with:
fetch-depth: 0

- name: Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
git checkout -b main origin/main
git checkout '${{github.event.pull_request.head.ref}}'
env:
GITHUB_TOKEN: ${{ github.token}}

- name: Setup Nodejs
uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: 16

- name: Install yarn
run: npm install -g yarn@v1

- name: Install Dep
run: |
yarn install --frozen-lockfile
- name: Update Pull Request
run: |
yarn changelog:ci
env:
GITHUB_TOKEN: ${{ github.token}}
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ yarn-error.log*

# Locks
# package-lock.json
yarn.lock
*/**/yarn.lock
*/yarn.lock

# Cache
.DS_Store
Expand Down
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "cloud-ui-materials",
"private": "true",
"scripts": {
"changelog": "node scripts/changelog.js",
"changelog:ci": "node scripts/changelog.js from-ci",
"changelog:comment": "node scripts/changelog.js from-comment"
},
"dependencies": {
"lodash.mergewith": "^4.6.2",
"node-fetch": "2"
}
}
12 changes: 12 additions & 0 deletions packages/cust/cust_community_icon_image/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## 1.0.3

Associated Task: [#281455](https://projectmanage.netease-official.lcap.163yun.com/dashboard/TaskDetail?id=2814552607417856)

### ✨Features

- [36a85cb](https://github.com/vusion/cloud-ui-materials/commit/36a85cb81dcdae782038830ad10d1bfb98e5ded5) Thanks [ncqwer](https://github.com/ncqwer) ! - 新增类型:带遮罩层的图片,对应的schema为:localImg://imageURL-mask_background_image

### 🚨BREAKING CHANGES

- [36a85cb](https://github.com/vusion/cloud-ui-materials/commit/36a85cb81dcdae782038830ad10d1bfb98e5ded5) Thanks [ncqwer](https://github.com/ncqwer) ! - 当前组件的内部使用的u-image默认的图片默认使用图片为fit为fill

Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@
group: 主要属性
brifeDoc: ''
tooltipLink: ''
- name: targetStyle
title: 样式属性
type: object
description: ''
group: 主要属性
brifeDoc: ''
tooltipLink: ''
slots: false
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,24 @@
<template>
<div>
<u-button @click="flag = !flag">toggle</u-button>
<cust-community-icon-image fit="fill" :src="flag ? '//test-lcpapp-static.nos-eastchina1.126.net/assets/cloud-ui/1.jpg' : ''" style="border-radius: 16px"></cust-community-icon-image>
<cust-community-icon-image
fit="fill"
:src="
flag
? 'https://defaulttenant.lcap.codewave-test.163yun.com/public/img/appTemplateImg2.23e7b648.png'
: ''
"
style="border-radius: 16px; width: 280px"></cust-community-icon-image>
<cust-community-icon-image fit="fill" style="border-radius: 16px"></cust-community-icon-image>
<cust-community-icon-image
fit="fill"
style="border-radius: 16px; width: 500px"
:targetStyle="targetStyle"></cust-community-icon-image>
<div>
<img src="https://defaulttenant.lcap.codewave-test.163yun.com/public/img/appTemplateImg2.23e7b648.png"></img>
<input type="color"/>
</div>
</div>
</template>
Expand All @@ -15,6 +30,11 @@ export default {
data() {
return {
flag: true,
targetStyle: {
imgWithMask: {
width: '256px',
},
},
};
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<template>
<div :class="$style.root">
<u-image :src="img" fit="fill"></u-image>
<div v-if="maskStyle" :class="$style.mask" :style="maskStyle"></div>
</div>
</template>

<script>
export default {
name: 'custom-community-icon-with-mask',
props: {
img: {
type: String,
default: undefined,
},
mask: {
type: String,
default: '',
},
},
computed: {
maskStyle() {
console.log(this.$attrs);
if (!this.mask) return null;
return {
'background-image': this.mask,
};
},
},
};
</script>

<style module>
.root {
position: relative;
display: inline-block;
overflow: hidden;
width: var(--image-width);
height: var(--image-height);
color: #fff;
}
.root [class^='u-image__'] {
width: 100%;
height: 100%;
}
.mask {
position: absolute;
pointer-events: none;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
</style>
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
<template>
<div :class="$style.root" :style="rootStyle">
<svg aria-hidden="true" :class="$style.icon"><use :xlink:href="iconName"></use></svg>
</div>
<div :class="$style.root" :style="rootStyle">
<svg aria-hidden="true" :class="$style.icon">
<use :xlink:href="iconName"></use>
</svg>
</div>
</template>

<script>
export default {
name: 'custom-community-icon',
props: {
backgroundImg: {
type: String,
default: undefined,
},
icon: {
type: String,
default: 'youjian',
}
},
computed: {
iconName(){
return `#others-${this.icon}`;
},
rootStyle(){
return {
'background-image': this.backgroundImg,
};
}
}
name: 'custom-community-icon',
props: {
backgroundImg: {
type: String,
default: undefined,
},
icon: {
type: String,
default: 'youjian',
},
},
computed: {
iconName() {
return `#others-${this.icon}`;
},
rootStyle() {
return {
'background-image': this.backgroundImg,
};
},
},
};
</script>

<style module>
.root{
position: relative;
display: inline-block;
overflow: hidden;
width: var(--image-width);
height: var(--image-height);
color: #fff;
.root {
position: relative;
display: inline-block;
overflow: hidden;
width: var(--image-width);
height: var(--image-height);
color: #fff;
}
.icon{
width: 100%;
height: 100%;
fill: currentColor;
.icon {
width: 100%;
height: 100%;
fill: currentColor;
}
</style>
</style>
Loading

0 comments on commit f15fbe1

Please sign in to comment.