Check for new Project Repos #46
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
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/[email protected] | |
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 }}" |