Last active
September 22, 2023 22:27
-
-
Save zkoppert/1c7439f8e67b874f3010bdd99648ce78 to your computer and use it in GitHub Desktop.
InnerSource crawler runner for GitHub Actions
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
# This workflow will install Python dependencies and run | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python Run | |
on: | |
repository_dispatch: | |
schedule: | |
- cron: '0 5 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Run the code | |
env: | |
ORGANIZATION: YOUR_ORG_NAME_HERE | |
TOPIC: inner-source | |
GH_TOKEN: ${{ secrets.YOUR_ACCESS_TOKEN_HERE }} | |
run: | | |
python ./crawler.py | |
- name: Upload repos.json file as a build artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: repos.json | |
path: repos.json | |
- name: Push file to InnerSource Project Portal repository | |
uses: dmnemec/copy_file_to_another_repo_action@v1.1.1 | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.YOUR_ACCESS_TOKEN_HERE }} | |
with: | |
source_file: 'repos.json' | |
destination_repo: 'YOUR_ORG_NAME_HERE/YOUR_PORTAL_REPO_HERE' | |
destination_branch: main | |
user_email: 'YOUR_EMAIL_HERE' | |
user_name: 'YOUR_USERNAME_HERE' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment