Skip to content

Check missing datasets #13

Check missing datasets

Check missing datasets #13

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