-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (85 loc) · 2.41 KB
/
generate_report.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Generate Score Report
on:
workflow_dispatch: # Can be triggered manually from GitHub Actions
inputs:
page-url:
description: "URL of the webpage listing all events"
required: true
type: string
entity-identifier:
description: "CSS to identify individual event webpages (example: div.event-card a)"
required: true
type: string
downloadFile:
description: "File name"
required: true
type: string
is-paginated:
description: "Is the page paginated? (true|false|[page number])"
required: true
type: string
headless:
description: "Run in headless mode? (true|false)"
required: true
type: string
workflow_call:
inputs:
page-url:
required: true
type: string
entity-identifier:
required: true
type: string
downloadFile:
required: true
type: string
is-paginated:
required: true
type: string
headless:
required: true
type: string
secrets:
GITHUB_TOKEN:
required: true
jobs:
call-reusable-workflow:
uses: culturecreates/artsdata-pipeline-action@v2
with:
mode: fetch
downloadFile: ${{inputs.downloadFile}}
page-url: ${{ inputs.page-url }}
entity-identifier: ${{ inputs.entity-identifier }}
is-paginated: ${{ inputs.is-paginated }}
headless: ${{ inputs.headless }}
token: ${{ secrets.GITHUB_TOKEN }}
save-method: 'artifact'
generate-report:
runs-on: ubuntu-latest
needs: call-reusable-workflow
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: jsonld-data
path: output/
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run main script
run: |
bundle exec ruby src/main.rb \
${{inputs.file_name}}
- name: Commit and Push Changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git pull
file_name="${{ inputs.file_name }}"
base_name="${file_name%.jsonld}"
git add "reports/${base_name}_report.csv"
git commit -m "Add data generated by the script"
git push