Update Project Status #142
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: Update Project Status | |
| # Controls when the workflow will run | |
| on: | |
| # Triggers the workflow once daily at 6 AM UTC | |
| schedule: | |
| - cron: '0 6 * * *' | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Also run on push for testing | |
| push: | |
| branches: | |
| - "main" | |
| paths: | |
| - 'scripts/update_project_status.R' | |
| - '.github/workflows/project-status-update.yml' | |
| # Trigger on pull requests targeting main | |
| pull_request: | |
| branches: | |
| - "main" | |
| jobs: | |
| update-status: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # Give the default GITHUB_TOKEN write permission to commit and push the | |
| # added or changed files to the repository. | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: 'release' | |
| - name: Install R system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev | |
| - name: Install R dependencies | |
| run: | | |
| Rscript -e "install.packages(c('yaml', 'data.table', 'httr', 'jsonlite'), repos='https://cloud.r-project.org/')" | |
| - name: Run project status update script | |
| run: | | |
| chmod +x scripts/update_project_status.R | |
| cd /home/runner/work/software/software | |
| Rscript scripts/update_project_status.R | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Commit all changed files back to the repository | |
| - name: Commit changes | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| # Optional commit message for the created commit. | |
| commit_message: 'Automatic project status update' | |
| file_pattern: 'project_status.md' |