Auto Check JSON Comments #229
This file contains hidden or 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: Auto Check JSON Comments | |
| on: | |
| push: | |
| branches: | |
| - master # Runs when pushing to the main branch | |
| schedule: | |
| - cron: '0 0 * * *' # Runs every day at midnight UTC | |
| jobs: | |
| feedback: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Check GitHub CLI version | |
| run: gh --version | |
| - name: Set up R | |
| uses: r-lib/actions/setup-r@v2 | |
| - name: Install pak | |
| run: | | |
| Rscript -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/devel/')" | |
| - name: Install specific R packages | |
| run: | | |
| Rscript -e "pak::pak(c('httr', 'dplyr', 'tibble','purrr', 'jsonlite','testthat'))" | |
| - name: Check if httr is installed | |
| run: | | |
| Rscript -e "if (!requireNamespace('httr', quietly = TRUE)) { stop('httr is NOT installed') } else { message('httr is installed') }" | |
| - name: Run simple-tests | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| GBIF_USER: ${{ secrets.GBIF_USER }} | |
| GBIF_PWD: ${{ secrets.GBIF_PWD }} | |
| run: | | |
| Rscript tests/simple-tests.R | |
| - name: Remove report.tsv if it exists | |
| run: | | |
| ls | |
| if [ -f "report.tsv" ]; then | |
| rm report.tsv | |
| fi | |
| - name: Run issue check script | |
| continue-on-error: true | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| GBIF_USER: ${{ secrets.GBIF_USER }} | |
| GBIF_PWD: ${{ secrets.GBIF_PWD }} | |
| run: | | |
| ls | |
| chmod +x ./issue_check.sh | |
| ./issue_check.sh | |
| - name: Check if report.tsv exists | |
| run: | | |
| if [ -f "report.tsv" ]; then | |
| echo "report.tsv exists" | |
| cat report.tsv | |
| else | |
| echo "report.tsv does not exist" | |
| exit 1 # Fail the job if the file is missing | |
| fi | |
| - name: Run issue label script | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| run: | | |
| ls | |
| chmod +x ./create_github_label.sh | |
| ./create_github_label.sh || true |