Publish Cloudflare Networks #572
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: "Publish Cloudflare Networks" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
env: | |
DEFAULT_CLOUDFLARE_NETWORKS_FILE: |- | |
cluster/apps/networking/traefik/cloudflare-networks.txt | |
jobs: | |
cloudflare-networks: | |
name: Cloudflare Networks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate Token | |
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 | |
id: generate-token | |
with: | |
app_id: "${{ secrets.APP_ID }}" | |
private_key: "${{ secrets.APP_PRIVATE_KEY }}" | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
token: "${{ steps.generate-token.outputs.token }}" | |
- name: Cloudflare Networks | |
run: | | |
cloudflare_networks_file=$(find . -name "cloudflare-networks.txt" -print -quit) | |
if [[ -f "${cloudflare_networks_file}" ]]; then | |
npx zx ./.github/scripts/cloudflareNetworks.mjs > "${cloudflare_networks_file}" | |
exit 0 | |
fi | |
npx zx ./.github/scripts/cloudflareNetworks.mjs > ${{ env.DEFAULT_CLOUDFLARE_NETWORKS_FILE }} | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 | |
with: | |
token: "${{ steps.generate-token.outputs.token }}" | |
branch: github-action/update-cloudflare-networks | |
delete-branch: true | |
title: "chore(github-action): update cloudflare networks" | |
signoff: true | |
commit-message: "chore(github-action): update cloudflare networks" | |
body: | | |
Update cloudflare networks from https://api.cloudflare.com/client/v4/ips | |
labels: | | |
renovate/github-action |