Skip to content

Commit

Permalink
Merge pull request #4 from hanfangyuan4396/bugfix/workflow-syntax-error
Browse files Browse the repository at this point in the history
ci: fix syntax error of workflow yaml file
  • Loading branch information
hanfangyuan4396 authored Oct 5, 2024
2 parents 629f459 + b2775e6 commit f2ef132
Showing 1 changed file with 40 additions and 43 deletions.
83 changes: 40 additions & 43 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Python distributions to PyPI
name: Publish Python distributions to PyPI

on:
release:
Expand All @@ -7,10 +7,9 @@ on:
env:
WECOM_WEBHOOK_URL: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${{ secrets.WECOM_WEBHOOK_KEY }}


jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI
name: Build and publish Python distributions to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -29,43 +28,41 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Notify success
if: success()
uses: actions/github-script@v6
with:
script: |
const webhookUrl = "${{ env.HFY_WECOM_WEBHOOK_URL }}";
const messageContent = "${{ github.repository }}" + "发布成功!";
const message = {
msgtype: "text",
text: {
content: messageContent
}
};
await github.request("POST " + webhookUrl, {
data: message,
headers: {
"Content-Type": "application/json"
}
});
- name: Notify failure
if: failure()
uses: actions/github-script@v6
with:
script: |
const webhookUrl = "${{ env.WECOM_WEBHOOK_URL }}";
const messageContent = "${{ github.repository }}" + "发布失败!";
const message = {
msgtype: "text",
text: {
content: messageContent
}
};
await github.request("POST " + webhookUrl, {
data: message,
headers: {
"Content-Type": "application/json"
}
});
- name: Notify success
if: success()
uses: actions/github-script@v6
with:
script: |
const webhookUrl = "${{ env.WECOM_WEBHOOK_URL }}";
const messageContent = "${{ github.repository }}" + "发布成功!";
const message = {
msgtype: "text",
text: {
content: messageContent
}
};
await github.request("POST " + webhookUrl, {
data: message,
headers: {
"Content-Type": "application/json"
}
});
- name: Notify failure
if: failure()
uses: actions/github-script@v6
with:
script: |
const webhookUrl = "${{ env.WECOM_WEBHOOK_URL }}";
const messageContent = "${{ github.repository }}" + "发布失败!";
const message = {
msgtype: "text",
text: {
content: messageContent
}
};
await github.request("POST " + webhookUrl, {
data: message,
headers: {
"Content-Type": "application/json"
}
});

0 comments on commit f2ef132

Please sign in to comment.