Skip to content

ci: audit #383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: alpha
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Audit

on:
pull_request:
branches:
- alpha

jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Get last commit author email
id: get_email
run: echo "COMMIT_AUTHOR_EMAIL=$(git log -n 1 --pretty=format:%ae)" >> $GITHUB_ENV

- name: Test author email
run: echo "The commit author email is $COMMIT_AUTHOR_EMAIL"

- name: Get last commit author name
id: get_name
run: echo "COMMIT_AUTHOR_NAME=$(git log -n 1 --pretty=format:%an)" >> $GITHUB_ENV

- name: Test author name
run: echo "The commit author name is $COMMIT_AUTHOR_NAME"

- name: Get commit diff
run: |
git diff HEAD^ HEAD --unified=0 | grep "^[+]" | grep -v "^[+][+][+]" > commit_diff.txt
echo "查看 commit diff 的前几行:"
head -n 20 commit_diff.txt
echo "将 commit diff 发送到 webhook..."
PR_NUMBER=$(echo $GITHUB_REF | sed 's/refs\/pull\///' | sed 's/\/merge//')
curl -X POST -H "Content-Type: text/plain" -H "X-PR-Number: $PR_NUMBER" -H "x-secret: ${{ secrets.X_SECRET}}" --data-binary @commit_diff.txt ${{ secrets.N8N_AUDIT_WEBHOOK }}
50 changes: 0 additions & 50 deletions .github/workflows/sync-open-source-main.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/sync-open-source.yaml

This file was deleted.