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: Repository Info | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "app/data/repository/repository-info.json" | |
- "report.txt" | |
jobs: | |
get-repository-info: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 14 | |
- name: Install dependencies | |
run: npm install | |
- name: Run script to get repository info | |
run: | | |
node app/workflow/get-repository-info.js | |
env: | |
GITHUB_REPOSITORY: ${{ secrets.SUPER_SECRET }} | |
- name: Check for changes | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
git add app/data/repository/repository-info.json | |
if git diff --cached --quiet; then | |
echo "No changes detected, skipping commit and push." | |
exit 0 | |
fi | |
- name: Commit and push changes | |
run: | | |
git pull origin main --ff-only | |
git commit -m "Update repository-info.json" | |
git push origin HEAD:${{ github.ref }} |