Skip to content

refactor(src): 优化消息推送服务调用代码 #24

refactor(src): 优化消息推送服务调用代码

refactor(src): 优化消息推送服务调用代码 #24

name: deploy
on:
pull_request:
branches:
- main
pull_request_target:
push:
branches:
- main
jobs:
deploy:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
id: push-notifications
with:
TYPE: Qmsg
TITLE: push-notifications action
DESP: "Commit ID: ${{ github.sha }}, Commit Message: ${{ github.event.head_commit.message }}, Repository: ${{ github.repository }}"
QMSG_KEY: ${{ secrets.QMSG_KEY }}
QMSG_QQ: ${{ secrets.QMSG_QQ }}
QMSG_PUSH_TYPE: send
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 9.0.4
- uses: actions/setup-node@v3
with:
node-version: 18.12.0
cache: pnpm
- name: Get pnpm store directory
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install
run: pnpm install
- name: Lint
run: pnpm lint
- name: Prettier
run: pnpm format-check
- name: Build
run: pnpm build
pushNotifications:
needs: lint
if: github.event.repository.name == 'pushNotifications'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: main
repository: dext7r/commit-comment
- name: Commit Comment
uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
This commit was made with the following details:
- Commit ID: ${{ github.sha }}
- Commit Message: ${{ github.event.head_commit.message }}
- Run_id: ${{ github.run_id }}
- Repository: ${{ github.repository }}
- Commit Time: ${{ github.event.head_commit.timestamp }}
- Commit Author: ${{ github.event.head_commit.author.name }}
- Commit Author Email: ${{ github.event.head_commit.author.email }}
- Commit Author Date: ${{ github.event.head_commit.author.date }}
- Commit Committer: ${{ github.event.head_commit.committer.name }}
- Commit Committer Email: ${{ github.event.head_commit.committer.email }}
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 10
keep_minimum_runs: 6