Run scrapper script #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run scrapper script | |
"on": | |
workflow_dispatch: | |
inputs: | |
session: | |
description: "Academic session" | |
default: "2022/2023" | |
required: true | |
type: string | |
semester: | |
description: "Semester" | |
default: 1 | |
required: true | |
type: choice | |
options: | |
- 1 | |
- 2 | |
- 3 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Dart SDK | |
id: setup-dart-sdk | |
uses: dart-lang/[email protected] | |
- name: Install dependencies | |
run: dart pub get | |
- name: Run scrapper | |
id: dart-scrapper | |
run: dart bin/albiruni_fetcher.dart --session ${{ inputs.session }} --sem ${{ inputs.semester }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "🗃️ update DB from ${{ github.run_id }}" | |
title: "🗃️ Update DB (session ${{ inputs.session }}, sem ${{ inputs.semester }})" | |
body: "![chart_iium_subjects](${{ steps.dart-scrapper.outputs.chart_link }})" | |
branch: update/db | |
base: master | |
- run: echo "Job completed successfully. Using **Dart ${{ steps.setup-dart-sdk.outputs.dart-version }}**" >> $GITHUB_STEP_SUMMARY | |
- run: echo "Scrap job for **session ${{ inputs.session }}** and **semester ${{ inputs.semester }}**" >> $GITHUB_STEP_SUMMARY |