Skip to content

Monitor Repos

Monitor Repos #6

Workflow file for this run

name: "Monitor Repos"
on:
workflow_dispatch:
schedule:
# Run every day
- cron: '0 1 * * *'
jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
steps:
- name: Setup
id: setup
run: |
echo "matrix=$(cat repos.json | jq -r -c '[.[] as {$repo, $paths} | $paths[] as $path | {$repo, 'path': $path}]')" >> $GITHUB_OUTPUT
- name: Check
run: jq . <<< '${{ steps.setup.outputs.matrix }}'
monitor_repos:
runs-on: ubuntu-latest
needs: [define-matrix]
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v2
- name: Check for sync file
env:
FILEPATH: .sync/${{ matrix.repo }}/${{ matrix.path }}
run: |
FILE="`basename "${FILEPATH}"`"
DIR="`dirname "${FILEPATH}"`"
# create the dir, then the file
mkdir -p "${DIR}"touch "${DIR}/${FILE}"
- uses: poll-github-repo/action@v1
with:
repo-to-sync: ${{ matrix.repo }}
path-to-sync: ${{ matrix.path }}
cache-path: .sync/${{ matrix.repo }}/${{ matrix.path }}
tracking-issue-label: upstream-sensor-updates-md
# Template for tracking issue title (see available placeholders below)
tracking-issue-title: "Update on {{ path }}: {{ sha-short }}"
# Template for tracking issue body (see available placeholders below)
tracking-issue-body: |
New commit in ${{ matrix.repo }}:
**{{ message }}** [link]({{ url }})
token: ${{ secrets.GITHUB_TOKEN }}
yes-create-issues: false