Compare commits

...

10 Commits

Author SHA1 Message Date
cong
d4587a67d3
Updated to the node16 runtime by default 2022-10-13 07:21:20 +08:00
cong
ac19805721
Merge pull request #10 from Ran-Xing/revert-9-revert-8-patch-1
Revert Update github-build.yml
2022-05-11 17:05:45 +08:00
星冉
e227b2bb1b
Revert "Revert "Update github-build.yml"" 2022-05-11 17:00:29 +08:00
cong
2bd1b5b725
Merge pull request #9 from Ran-Xing/revert-8-patch-1
Revert "Update github-build.yml"
2022-05-11 16:45:17 +08:00
星冉
25484e5222
Update github-build.yml 2022-05-11 16:40:10 +08:00
星冉
1ec1cc4e4e
Revert "Update github-build.yml" 2022-05-11 16:13:47 +08:00
cong
c284c64f39
Merge pull request #8 from Ran-Xing/patch-1
Update github-build.yml
2022-05-11 15:57:39 +08:00
星冉
b289e2f92d
Update github-build.yml 2022-05-11 15:56:17 +08:00
cong
613b859e0b
Merge pull request #7 from XRSecAdmin/patch-1
Create github-build.yml
2022-05-09 19:11:31 +08:00
星冉
dc67211c0b
Create github-build.yml
写的比较多,可以参考下,
只需要填写: DING_SECRET DING_TOKEN
可选:TOKEN_GITHUB
2022-05-09 18:56:16 +08:00
2 changed files with 58 additions and 1 deletions

View File

@ -19,5 +19,5 @@ inputs:
required: false
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'

57
examples/github-build.yml Normal file
View File

@ -0,0 +1,57 @@
name: Build
on:
workflow_dispatch:
push:
jobs:
Build:
name: Build
runs-on: ubuntu-latest
steps:
-
name: Private Actions Checkout
uses: actions/checkout@v2
### show time now
####
####
-
name: Get Data
id: getDingData
run: |
# 输出仓库名
REPOSITORY="${{GITHUB.REPOSITORY}}"
echo "::set-output name=REPOSITORY::${REPOSITORY#*/}"
# 获取用户仓库信息
RESPONSE="$(curl -sLm 10 https://api.github.com/repos/${{ GITHUB.REPOSITORY }})"
# 建议填写自己的 TOKEN
# RESPONSE="$(curl -sLm 10 https://api.github.com/repos/${{ GITHUB.REPOSITORY }} -H "Authorization: token ${{ SECRETS.TOKEN_GITHUB }}")"
# 获取 用户仓库 设置的 描述,如果为空,可能是没有使用 TOKEN
DESCRIPTION="$(jq -r .description <(echo ${RESPONSE}))"
echo "::set-output name=DESCRIPTION::${DESCRIPTION}"
# 获取 用户仓库 设置的 URL, 如果没有就输出 Github 地址
URL="$(jq -r .homepage <(echo ${RESPONSE}))"
if [[ "${URL}" != "null" || "${URL}" != "" ]]; then
echo "::set-output name=URL::${URL}"
else
echo "::set-output name=URL::${{ GITHUB.SERVER_URL }}/${{ GITHUB.REPOSITORY }}"
fi
-
name: Send dingding notify
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ SECRETS.DING_TOKEN }}
secret: ${{ SECRETS.DING_SECRET }}
body: |
{
"msgtype": "link",
"link": {
"text": "${{ steps.getDingData.outputs.DESCRIPTION }}",
"title": "${{ steps.getDingData.outputs.REPOSITORY }} WorkFlow ${{ GITHUB.JOB }} Success!",
"picUrl": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"messageUrl": "${{ steps.getDingData.outputs.URL }}"
}
}