File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Estrutura ANAC
22on :
3- workflow_dispatch : {}
4- push :
5- paths :
6- - .github/workflows/estrutura.yml
7- schedule :
8- - cron : " 0 3-6 * * 0-6"
3+ workflow_dispatch :
94
105jobs :
11- schedule :
6+ download-file :
127 runs-on : ubuntu-latest
138 steps :
14- - name : Setup deno
15- uses : denoland/setup-deno@main
16- with :
17- deno-version : v1.x
18-
199 - name : Check out repo
2010 uses : actions/checkout@v4
2111
22- - name : Fetch data
23- uses : githubocto/flat@v3
12+ - name : Baixar arquivo JSON da API
13+ uses : githubocto/flat@v4
2414 with :
25- http_url : " https://estruturaorganizacional.dados.gov.br/doc/estrutura-organizacional/completa.json?codigoPoder=1&codigoEsfera=1&codigoUnidade=86144&retornarOrgaoEntidadeVinculados=SIM"
26- downloaded_filename : " anac/estrutura.json"
27- flatten : " false"
15+ # A URL da API
16+ http_url : ' https://estruturaorganizacional.dados.gov.br/doc/estrutura-organizacional/completa.json?codigoPoder=1&codigoEsfera=1&codigoUnidade=86144&retornarOrgaoEntidadeVinculados=SIM'
17+ downloaded_filename : ' anac/estrutura.json'
18+ # NOVO E IMPORTANTE: Garante que o JSON seja salvo em seu formato original, sem processamento.
19+ flatten : ' false'
2820
29- - name : Pós-processamento JSON (Deno)
30- run : deno run --allow-read --allow-write ./scripts/estrutura.ts anac/estrutura.json
21+ - name : Commit e push de arquivos, se houver mudanças
22+ run : |
23+ git config user.name github-actions
24+ git config user.email [email protected] 25+ git add :/
26+ COMMIT_MESSAGE="$(date +"%Y-%m-%d %H:%M")"
27+ git commit -m "$COMMIT_MESSAGE" || exit 0
28+ git pull --rebase
29+ git push
You can’t perform that action at this time.
0 commit comments