React application news ticker #109
Workflow file for this run
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: Merge Samples | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
types: [closed] | |
jobs: | |
merge_samples: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.merged == true || github.event_name == 'push' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Merge samples | |
run: node .github/scripts/merge-samples/index.js | |
- name: Commit and push if necessary | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action" | |
git add -A | |
git diff --staged --quiet || git commit -m "Automated samples.json update" | |
git push |