github.com/letsencrypt/boulder@v0.20251208.0/.github/workflows/check-iana-registries.yml (about)

     1  name: Check for IANA special-purpose address registry updates
     2  
     3  on:
     4    schedule:
     5      - cron: "20 16 * * *"
     6    workflow_dispatch:
     7  
     8  jobs:
     9    check-iana-registries:
    10      runs-on: ubuntu-latest
    11  
    12      permissions:
    13        contents: write
    14        pull-requests: write
    15  
    16      steps:
    17        - name: Checkout iana/data from main branch
    18          uses: actions/checkout@v4
    19          with:
    20            sparse-checkout: iana/data
    21  
    22        # If the branch already exists, this will fail, which will remind us about
    23        # the outstanding PR.
    24        - name: Create an iana-registries-gha branch
    25          run: |
    26              git checkout --track origin/main -b iana-registries-gha
    27  
    28        - name: Retrieve the IANA special-purpose address registries
    29          run: |
    30              IANA_IPV4="https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry-1.csv"
    31              IANA_IPV6="https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry-1.csv"
    32  
    33              REPO_IPV4="iana/data/iana-ipv4-special-registry-1.csv"
    34              REPO_IPV6="iana/data/iana-ipv6-special-registry-1.csv"
    35  
    36              curl --fail --location --show-error --silent --output "${REPO_IPV4}" "${IANA_IPV4}"
    37              curl --fail --location --show-error --silent --output "${REPO_IPV6}" "${IANA_IPV6}"
    38  
    39        - name: Create a commit and pull request
    40          env:
    41            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    42          shell:
    43            bash
    44          # `git diff --exit-code` returns an error code if there are any changes.
    45          run: |
    46              if ! git diff --exit-code; then
    47                  git add iana/data/
    48                  git config user.name "Irwin the IANA Bot"
    49                  git commit \
    50                      --message "Update IANA special-purpose address registries"
    51                  git push origin HEAD
    52                  gh pr create --fill
    53              fi