mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-28 16:51:26 +00:00
🐛 fix workflow vulnerability #79
This commit is contained in:
33
.github/workflows/upload_docs.yml
vendored
Normal file
33
.github/workflows/upload_docs.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Upload API Doc
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Build API Doc"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
upload:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.workflow_run.head_sha }}
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
- uses: dawidd6/action-download-artifact@v2
|
||||
with:
|
||||
workflow: ${{ github.event.workflow_run.workflow_id }}
|
||||
name: docs
|
||||
path: docs/
|
||||
|
||||
- env:
|
||||
REF: ${{ github.event.workflow_run.head_branch }}
|
||||
run: |
|
||||
git config user.name GitHub
|
||||
git config user.email noreply@github.com
|
||||
git add .
|
||||
git diff-index --quiet HEAD || git commit -m ":memo: update api docs"
|
||||
git remote add target "https://github.com/${{ github.event.workflow_run.head_repository.full_name }}.git"
|
||||
git push target HEAD:$REF
|
Reference in New Issue
Block a user