Check missing datasets #13
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: Check missing datasets | |
| on: | |
| schedule: | |
| - cron: "0 4 * * 0" # Sunday midnight EDT | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: "environment to use" | |
| required: true | |
| default: "development" | |
| type: choice | |
| options: | |
| - prod | |
| - staging | |
| - development | |
| permissions: | |
| contents: read | |
| issues: write | |
| jobs: | |
| check-missing-datasets: | |
| runs-on: ubuntu-latest | |
| environment: ${{ github.event_name == 'schedule' && 'prod' || inputs.environment }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: run task | |
| uses: cloud-gov/cg-cli-tools@main | |
| with: | |
| command: > | |
| cf run-task datagov-harvest | |
| --name "check-missing-datasets-${{ github.run_id }}" | |
| --command "python scripts/count_missing_outdated_datasets.py" -m 2G | |
| cf_org: gsa-datagov | |
| cf_space: ${{ github.event_name == 'schedule' && 'prod' || inputs.environment }} | |
| cf_username: ${{secrets.CF_SERVICE_USER}} | |
| cf_password: ${{secrets.CF_SERVICE_AUTH}} | |
| - name: monitor task output | |
| timeout-minutes: 20 | |
| uses: cloud-gov/cg-cli-tools@main | |
| with: | |
| command: > | |
| bin/monitor_cf_logs.sh datagov-harvest "check-missing-datasets-${{ github.run_id }}" | |
| cf_org: gsa-datagov | |
| cf_space: ${{ github.event_name == 'schedule' && 'prod' || inputs.environment }} | |
| cf_username: ${{secrets.CF_SERVICE_USER}} | |
| cf_password: ${{secrets.CF_SERVICE_AUTH}} | |
| - name: Create Issue for failure | |
| if: ${{ failure() }} | |
| uses: JasonEtco/create-an-issue@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }} | |
| GITHUB_JOB: ${{ toJson(github)['job'] }} | |
| GITHUB_ATTEMPTS: ${{ github.run_attempt }} | |
| LAST_COMMIT: ${{ github.sha }} | |
| LAST_RUN_BY: ${{ github.actor }} | |
| RUN_ID: ${{ github.run_id }} | |
| COMMAND: python scripts/count_missing_outdated_datasets.py | |
| ENVIRONMENT: ${{ github.event_name == 'schedule' && 'prod' || inputs.environment }} | |
| with: | |
| filename: .github/missing_datasets.md |