Skip to content

Update github.js

Update github.js #169

Workflow file for this run

name: Push to Feishu Webhook
on:
push:
branches: [main, dev]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Push to Feishu Webhook
uses: actions/[email protected]
with:
script: |
const commit = await github.rest.repos.getCommit({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `${{ github.sha }}`
})
const response = await fetch('https://open.feishu.cn/open-apis/bot/v2/hook/${{ secrets.FEISHU_HOOK_TOKEN }}', {
method: 'POST', // Adjust the method as needed
body: JSON.stringify({"msg_type": "text",
"content": {"text": `event: ${{ github.event_name }},\nref_name: [${{ github.ref_name }}](https://github.com/askman-dev/askman-chrome-extension/commits/${{ github.ref_name }}/),\nmessage: ${commit.data.commit.message}\nauthor: ${commit.data.commit.author.name}`}}), // Customize the payload
headers: {
'Content-Type': 'application/json',
},
});
console.log('Message sent:', response.status, response.statusText);