Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
InnerSource crawler runner for GitHub Actions
# 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.0.4
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'
@mmiah7286

This comment has been minimized.

Copy link

@mmiah7286 mmiah7286 commented Apr 13, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment