See New Course Titles #298
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: See New Course Titles | |
on: | |
workflow_run: | |
workflows: ["Ferry Run"] | |
types: | |
- completed | |
workflow_dispatch: | |
jobs: | |
extract-courses: | |
runs-on: ubuntu-latest | |
if: false # broken will fix later ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | |
steps: | |
- name: Checkout ferry-data | |
uses: actions/checkout@v2 | |
with: | |
repository: coursetable/ferry-data | |
token: ${{ secrets.TOKEN_FOR_FERRY_DATA }} | |
path: ferry-data | |
fetch-depth: 1 # Fetches only the last commit | |
- name: Fetch the latest commit SHA from ferry-data | |
if: github.event_name == 'workflow_run' | |
id: get-latest-commit | |
run: echo "LATEST_COMMIT_SHA=$(git log -1 --format=%H)" >> $GITHUB_ENV | |
working-directory: ./ferry-data | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.8" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests | |
- name: Run Python script to extract new courses | |
env: | |
TOKEN_FOR_FERRY_DATA: ${{ secrets.GITHUB_TOKEN }} | |
LATEST_COMMIT_SHA: ${{ env.LATEST_COMMIT_SHA }} | |
run: python ./ferry-data/.github/scripts/get_course_names.py | |
- name: Output new courses | |
run: cat new_courses.txt |