Skip to content

.github/workflows/generate_report.yml #1

.github/workflows/generate_report.yml

.github/workflows/generate_report.yml #1

name: Generate Score Report
on:
workflow_dispatch: # Can be triggered manually from GitHub Actions
inputs:
page_url:
description: "The URL of the page to fetch JSON-LD data from"
required: true
type: string
entity_identifier:
description: "Identifier of the entity to fetch"
required: true
type: string
file_name:
description: "The name of the output file"
required: true
type: string
is_paginated:
description: "Is the page paginated? Set as 'true', 'false', or a page number"
required: true
type: string
headless:
description: "Run in headless mode ('true' or 'false')"
required: true
type: string
jobs:
call-reusable-workflow:
uses: culturecreates/artsdata-orion/.github/workflows/fetch-data.yml@main
with:
page_url: ${{ inputs.page_url }}
entity_identifier: ${{ inputs.entity_identifier }}
file_name: ${{ inputs.file_name }}
is_paginated: ${{ inputs.is_paginated }}
headless: ${{ inputs.headless }}
generate-report:
runs-on: ubuntu-latest
needs: call-reusable-workflow
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
repository: culturecreates/artsdata-orion
ref: main
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run main script
run: |
bundle exec ruby src/main.rb \
"https://raw.githubusercontent.com/culturecreates/artsdata-score/${{ needs.call-reusable-workflow.outputs.commit-hash }}/outputs/${{inputs.file_name}}.jsonld" \
"reports/${{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
git add "report/${{ inputs.file_name }}"
git commit -m "Add data generated by the script"
git push