Skip to content

Check for new Project Repos #1029

Check for new Project Repos

Check for new Project Repos #1029

Workflow file for this run

name: Check for new Project Repos
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * *"
jobs:
check-project-repos:
runs-on: ubuntu-latest
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/github-app-token@v1.5.0
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780
- uses: actions/checkout@v2
- name: Update project repositories
env:
GITHUB_TOKEN: ${{ steps.github_app_token.outputs.token }}
run: |
npm install -g meta
./bin/check-repos.sh
echo REPOS_ADDED=$(git diff --unified=0 .gitignore | grep '+/' | cut -f2 -d'/' | paste -sd ',' - | sed "s/,/, /g" | sed 's/\(.*\),/\1 and/') >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ steps.github_app_token.outputs.token }}
commit-message: Added ${{ env.REPOS_ADDED }}.
signoff: true
delete-branch: true
title: 'Added ${{ env.REPOS_ADDED }}.'
body: |
Added ${{ env.REPOS_ADDED }}.
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"