locate: Nigeria #17
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: geoCountry | |
on: | |
issues: | |
types: | |
- opened | |
- reopened | |
jobs: | |
locate: | |
permissions: | |
issues: write | |
contents: write | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.issue.title, 'locate:') | |
steps: | |
- uses: actions/checkout@v3 | |
# Set up a Python 3.10 (64-bit) instance | |
- name: Setting up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
architecture: "x64" | |
# Use pip to install the dependencies and then run the script | |
- name: geoLocate | |
env: | |
ISSUE_NUMBER: ${{ github.event.issue.number }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REPOSITORY_OWNER: ${{ github.repository_owner }} | |
run: | | |
pip install -r requirements.txt | |
python main.py | |
# Create new commit with the changed files and push it to GitHub | |
- name: Commit and push changes | |
env: | |
ISSUE_TITLE: ${{ github.event.issue.title }} | |
ISSUE_AUTHOR: ${{ github.event.issue.user.login }} | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "${ISSUE_TITLE} by ${ISSUE_AUTHOR}" | |
git push |