Create workflow.yml #1
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: Pull Request Checks | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
types: [opened, synchronize] | |
permissions: | |
contents: read | |
jobs: | |
greet_contributor: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Greet the contributor | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
curl -s -X POST -H "Authorization: token $GITHUB_TOKEN" \ | |
-d '{"body": "👋 Thanks for the pull request! Our team will review it soon."}' \ | |
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" | |
lint_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pylint # Install pylint for linting | |
- name: Run Python linter (Pylance) | |
run: | | |
pylint crs_scraper | |
# Will need later if there are tests already | |
# - name: Run tests | |
# run: | | |
# pytest |