Skip to content

Instantly share code, notes, and snippets.

@zkoppert
Created January 29, 2021 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zkoppert/b5db11f29f46ac7f202eb45b9be935c8 to your computer and use it in GitHub Desktop.
Save zkoppert/b5db11f29f46ac7f202eb45b9be935c8 to your computer and use it in GitHub Desktop.
innersource crawler workflow example
# 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
# Replave YOUR_GH_TOKEN_HERE, YOUR_USER_NAME, YOUR_EMAIL_ADDRESS, and YOUR_ORGANIZATION_NAME_HERE strings below
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_ORGANIZATION_NAME_HERE
TOPIC: inner-source
GH_TOKEN: ${{ secrets.YOUR_GH_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_GH_TOKEN_HERE }}
with:
source_file: 'repos.json'
destination_repo: 'YOUR_ORGANIZATION_NAME_HERE/innersource-portal'
destination_branch: main
user_email: 'YOUR_EMAIL_ADDRESS'
user_name: 'YOUR_USER_NAME'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment