forked from common-voice/cv-sentence-extractor
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (70 loc) · 2.66 KB
/
manual-issue-trigger.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Used to trigger actions from issue or PR comments.
# See the README for more information.
name: Manual Issue Trigger
on:
issue_comment:
types: [created]
jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [nightly-2023-06-28]
steps:
# SETUP
- name: Maximize build space
uses: easimon/maximize-build-space@b4d02c14493a9653fe7af06cc89ca5298071c66e
with:
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
- uses: hecrj/setup-rust-action@50a120e4d34903c2c1383dec0e9b1d349a9cc2b1
with:
rust-version: ${{ matrix.rust }}
- uses: actions/checkout@v3
# COMMENT
- name: Get Comment
id: comment
env:
BODY: ${{ github.event.comment.body }}
run: |
ACTION_LINE=$(echo "$BODY" | grep "/action " || echo "no-action")
ACTION=${ACTION_LINE/\/action /""}
echo "##[set-output name=action;]$ACTION"
- name: Create comment
if: "!contains(steps.comment.outputs.action, 'no-action')"
uses: peter-evans/create-or-update-comment@dfd809e21f4d5cfc0a52e70caed06890c58d2e6d
with:
issue-number: ${{ github.event.issue.number }}
body: |
Job started: https://github.com/${{ github.repository }}/actions/runs/${{github.run_id}}
# BLOCKLIST
- name: Full Wikipedia Extraction - no checks for blocklist
if: "contains(steps.comment.outputs.action, 'blocklist')"
run: ./scripts/extraction.sh ${{ steps.comment.outputs.action }}
- name: Checkout cvtools
if: "contains(steps.comment.outputs.action, 'blocklist')"
uses: actions/checkout@v3
with:
repository: dabinat/cvtools
path: cvtools
- name: Generate Blocklist
if: "contains(steps.comment.outputs.action, 'blocklist')"
run: ./scripts/create-blocklist.sh ${{ steps.comment.outputs.action }}
- uses: actions/upload-artifact@v3
if: "contains(steps.comment.outputs.action, 'blocklist')"
with:
name: blocklist
path: output/*
# CREATE FINAL COMMENT
- name: Create final comment
if: "!contains(steps.comment.outputs.action, 'no-action')"
uses: peter-evans/create-or-update-comment@dfd809e21f4d5cfc0a52e70caed06890c58d2e6d
with:
issue-number: ${{ github.event.issue.number }}
body: |
Job finished: https://github.com/${{ github.repository }}/actions/runs/${{github.run_id}}
Don't forget to download the artifacts.