Skip to content

Update ips.yml

Update ips.yml #23

Workflow file for this run

name: "Handle Allowed IPs"
on:
workflow_dispatch:
push:
branches:
- 'ip-develop'
jobs:
handle_allowed_ips:
name: "Handle Allowed IPs"
runs-on: ubuntu-latest
outputs:
ips: ${{ steps.parseIps.outputs.ips }}
steps:
- name: "Checkout"
# @see https://github.com/actions/checkout
uses: actions/checkout@v4
# with:
# repository: 'ministryofjustice/moj-ip-addresses'
# ref: 'main'
# # This is a fine grained PAT, it's scoped to the moj-ip private repository
# # with the single permission: Content: Read-only.
# # The token is pending approval: https://github.com/settings/personal-access-tokens/3669004
# token: ${{ secrets.MOJ_IP_ADDRESSES_RO_PAT }}
- name: "Parse IPs"
id: parseIps
uses: mikefarah/yq@master
with:
cmd: |
IPS=$(yq 'explode(.) | {"deprecating": .deprecating_access_to_moj_intranet | flatten, "allow": .allow_access_to_moj_intranet | flatten }' -o json -I=0 deploy/config/example-moj-ips.yaml)
echo ::add-mask::$IPS
echo "ips=$IPS" >> $GITHUB_OUTPUT
- name: Reuse a variable obtained in another step
run: |
IPS="${{ steps.parseIps.outputs.ips }}"
echo ::add-mask::$IPS
echo $IPS