forked from huggingface/transformers
-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (50 loc) · 1.55 KB
/
delete_dev_documentation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Delete dev documentation
on:
pull_request:
types: [ closed ]
jobs:
build_and_package:
runs-on: [self-hosted, doc-builder]
container:
image: huggingface/doc-builder-transformers
options: "-v /home/github_actions:/mnt"
env:
PR_NUMBER: ${{ github.event.number }}
steps:
- uses: actions/checkout@v2
- name: Set env
run: echo "WRITE=$(cat /mnt/WRITE)" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
repository: 'huggingface/doc-build-dev'
path: doc-build-dev
token: ${{ env.WRITE }}
- name: Setup git
run: |
git config --global user.name "Hugging Face Doc Builder"
git config --global user.email [email protected]
- name: Push to repositories
run: |
cd doc-build-dev
ls
rm -rf transformers/pr_$PR_NUMBER
ls
git add .
git commit -m "Closed PR ${GITHUB_REF##*/}"
git push origin main
- name: Find Comment
if: ${{ always() }}
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ env.PR_NUMBER }}
comment-author: HuggingFaceDocBuilder
- name: Update comment
if: ${{ always() }}
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
token: ${{ env.WRITE }}
edit-mode: replace
body: |
_The documentation is not available anymore as the PR was closed or merged._