2. Check posts for bugs and content #29
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: 2. Check posts for bugs and content | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 2 1 * *" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check-figures: | |
runs-on: ubuntu-latest | |
outputs: | |
status: ${{ steps.check.outputs.status }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Check if there are any .yml files in the figures folder | |
id: check | |
run: | | |
if [ -n "$(find figures -name '*.yml' -print -quit)" ]; then | |
#echo "::set-output name=status::proceed" | |
echo "status=proceed" >> $GITHUB_OUTPUT | |
else | |
#echo "::set-output name=status::quit" | |
echo "status=quit" >> $GITHUB_OUTPUT | |
fi | |
check-posts: | |
needs: check-figures | |
if: ${{needs.check-figures.outputs.status == 'proceed' }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: main | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Install packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install libcurl4-openssl-dev | |
Rscript -e 'install.packages(c("stringr","yaml"))' | |
- name: Run check_posts.R | |
run: | | |
Rscript -e "source('scripts/check_posts.R')" | |
- name: Commit log | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: check.log for new posts |