Estrutura ANAC #20
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: Estrutura ANAC | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| schedule: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup deno | |
| uses: denoland/setup-deno@main | |
| with: | |
| deno-version: v1.x | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| # URL dos dados a serem baixados (http_url) e on nomes dos arquivos (downloaded_filename) | |
| - name: Fetch data | |
| uses: githubocto/flat@v3 | |
| with: | |
| # A URL da API | |
| http_url: 'https://estruturaorganizacional.dados.gov.br/doc/estrutura-organizacional/completa.json?codigoPoder=1&codigoEsfera=1&codigoUnidade=86144&retornarOrgaoEntidadeVinculados=SIM' | |
| downloaded_filename: 'anac/estrutura.json' | |
| # NOVO E IMPORTANTE: Garante que o JSON seja salvo em seu formato original, sem processamento. | |
| flatten: 'false' | |
| - name: Commit e push de arquivos, se houver mudanças | |
| run: | | |
| git config user.name github-actions | |
| git config user.email [email protected] | |
| git add :/ | |
| COMMIT_MESSAGE="$(date +"%Y-%m-%d %H:%M")" | |
| git commit -m "$COMMIT_MESSAGE" || exit 0 | |
| git pull --rebase | |
| git push |