Find Outbound IPs #257
This file contains 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: Find Outbound IPs | |
'on': | |
workflow_dispatch: { } | |
schedule: | |
- cron: '1 0 * * *' | |
jobs: | |
outboundips: | |
name: Outbound IPs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: azure/login@v2 | |
with: | |
creds: '{"clientId":"${{ secrets.AZURE_APPLICATION_ID }}","clientSecret":"${{ secrets.AZURE_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}' | |
- name: Get Outbound IPs | |
shell: bash | |
run: | | |
# Get the outbound IPs for the agent function | |
IFS=',' read -r -a agentarray <<< $(az functionapp show --resource-group OctopusAIAgent --name octopusaiagent --query possibleOutboundIpAddresses --output tsv) | |
# Get the outbound IPs for the octoterra function | |
IFS=',' read -r -a octoterraarray <<< $(az functionapp show --resource-group OctopusAIAgent --name octoterra --query possibleOutboundIpAddresses --output tsv) | |
# Combine the arrays | |
combined=( "${agentarray[@]}" "${octoterraarray[@]}" ) | |
# Get the unique values | |
printf "%s\n" "${combined[@]}" | sort -u > outboundips.txt | |
- uses: EndBug/add-and-commit@v9 | |
with: | |
message: Update outbound IP addresses | |
committer_name: GitHub Actions | |
committer_email: [email protected] | |
permissions: | |
contents: write |