Create scubed.rbind.io.json #135
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
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'blogs/**' | |
name: Validate and clean jsons | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v12 | |
with: | |
files: blogs/ | |
- name: Cleanup json template comments | |
if: ${{ steps.changed-files.outputs.any_changed }} | |
run: | | |
for f in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
echo Cleaning $f | |
sed -i 's.//required..g' $f | |
done | |
- name: Install cURL Headers | |
run: | | |
sudo apt-get update | |
sudo apt-get install libcurl4-openssl-dev | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
version: 'renv' | |
- name: Setup renv | |
uses: r-lib/actions/setup-renv@v2 | |
- name: Validate jsons | |
run: Rscript 'scripts/validate_jsons.R' | |
- name: Commit data | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --local user.name "$GITHUB_ACTOR" | |
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
git commit blogs/ -m 'Commit cleaned jsons' || echo "No changes to commit" | |
git push origin || echo "Nothing to push" |