Skip to content

save-iregs

save-iregs #1

Workflow file for this run

name: Save ecfr as text
on:
workflow_dispatch:
schedule:
- cron: '5 9 * * *'
env:
PARTS: "1002,1003,1004,1005,1006,1007,1008,1010,1011,1012,1013,1016,1022,1024,1026,1030,1041"
jobs:
save-ecfr:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Installs htmlq
uses: baptiste0928/[email protected]
with:
crate: htmlq
version: "0.4.0"
- name: Find latest date
id: date
uses: sergeysova/jq-action@a3f0d4ff59cc1dddf023fc0b325dd75b10deec58
with:
cmd: "curl -sSL https://www.ecfr.gov/api/versioner/v1/titles.json | jq '.titles[] | select(.number == 12) | .up_to_date_as_of' | tr -d '\"'"
- name: Fetch and extract parts from eCFR
run: |
IFS="," read -a BASH_PARTS <<< "$PARTS"
for PART in "${BASH_PARTS[@]}"; do
echo "$PART"
curl -sSL "https://www.ecfr.gov/api/renderer/v1/content/enhanced/${{ steps.date.outputs.value }}/title-12?chapter=X&part=${PART}" | htmlq -t '.part' | sed '/^$/d' > "./ecfr/${PART}.txt"
done
- name: Commit text
uses: stefanzweifel/[email protected]
with:
commit_message: ecfr update: ${{ steps.date.output.value }}

Check failure on line 44 in .github/workflows/save-ecfr.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/save-ecfr.yml

Invalid workflow file

You have an error in your yaml syntax on line 44