Skip to content

Commit d85ea1a

Browse files
committed
Update action.yml
1 parent 80433f1 commit d85ea1a

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

.github/actions/update-firewall-rule/action.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,24 @@ runs:
1010
using: composite
1111
steps:
1212
- name: ${{ inputs.action-to-execute }} Firewall Rule
13-
shell: bash
13+
shell: pwsh
1414
run: |
15-
AgentPublicIp=$(curl checkip.amazonaws.com)
16-
echo "##[warning]${{ inputs.action-to-execute }}ing $AgentPublicIp To Storage Account Firewall, Please Wait..."
17-
az network nsg rule update -n HTTPS_CI --nsg-name vmsonarqubeprod001-nsg -g rg-prgssonarqube-prod-001 --${{ inputs.action-to-execute }} sourceAddressPrefixes $AgentPublicIp
18-
sleep 30
19-
# was echo "##[warning]Adding $AgentPublicIp To Storage Account Firewall, Please Wait..."
15+
$AgentPublicIp = Invoke-RestMethod https://checkip.amazonaws.com
16+
Write-Host "##[warning]${{ inputs.action-to-execute }}ing $AgentPublicIp To Storage Account Firewall, Please Wait..."
17+
az keyvault network-rule ${{ inputs.action-to-execute }} --name caps-evcodesign-useast --ip-address $AgentPublicIp
18+
Start-Sleep -Seconds 20
19+
20+
21+
# shell: bash
22+
# run: |
23+
# AgentPublicIp=$(curl checkip.amazonaws.com)
24+
# echo "##[warning]${{ inputs.action-to-execute }}ing $AgentPublicIp To Storage Account Firewall, Please Wait..."
25+
# az network nsg rule update -n HTTPS_CI --nsg-name vmsonarqubeprod001-nsg -g rg-prgssonarqube-prod-001 --${{ inputs.action-to-execute }} sourceAddressPrefixes $AgentPublicIp
26+
# CANONICAL UPDATED az network nsg rule update -n HTTPS_CI --nsg-name vmsonarqubeprod001-nsg -g rg-prgssonarqube-prod-001 --${{ inputs.action-to-execute }} --source-address-prefixes $AgentPublicIp
27+
# CANONICAL az network nsg rule update --name MyNsgRule --nsg-name MyNsg --resource-group MyResourceGroup --source-address-prefixes 208.130.28/24
28+
# sleep 30
29+
30+
# # was echo "##[warning]Adding $AgentPublicIp To Storage Account Firewall, Please Wait..."
2031
# was AgentPublicIp=$(curl ipconfig.io) which returned a 522/timeout error, so switched to checkip.amazonaws.com
2132
# az network nsg rule update -n HTTPS_CI --nsg-name vmsonarqubeprod001-nsg -g rg-prgssonarqube-prod-001 --add sourceAddressPrefixes $AgentPublicIp
2233

0 commit comments

Comments
 (0)