Update generate-flags.js #18
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: Generate Flags | |
on: | |
push: | |
paths: | |
- 'scripts/generate-flags.js' | |
- '.github/workflows/generate-flags.yml' | |
- 'package.json' | |
- 'package-lock.json' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Cache Node.js modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies if needed | |
if: ${{ github.event_name == 'push' && github.event.head_commit.modified && contains(github.event.head_commit.modified, 'package.json') }} | |
run: npm install | |
- name: Clean install (npm ci) | |
run: npm ci | |
- name: Generate flags | |
run: node scripts/generate-flags.js | |
- name: Commit and push changes | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add --all flags/ | |
git commit -m "Update and delete outdated flags" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |