Skip to content

Unofficial Monarch API #224

Unofficial Monarch API

Unofficial Monarch API #224

Workflow file for this run

name: Update Cloudflare KV values for issue slugs
on:
issues:
types: [opened, edited, deleted]
jobs:
update-cloudflare-slug:
runs-on: ubuntu-latest
steps:
# To use this repository's private action,
# you must check out the repository
# - name: Checkout
# uses: actions/checkout@v3
- name: Update Cloudflare Slug
uses: pbassham/slugify-issue@main # Uses an action in the root directory
id: update-slug
env:
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_TOKEN }}
# CLOUDFLARE_ACCOUNT_EMAIL: ${{ secrets.CLOUDFLARE_ACCOUNT_EMAIL }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
with:
namespace_identifier: ${{secrets.CLOUDFLARE_NAMESPACE_ID}}
# revalidate_token: ${{secrets.REVALIDATE_TOKEN}}
# with:
# who-to-greet: "Mona the Octocat"
# text: "Mona the Octocat Slug"
# cloudflare_account_id: ${{secrets.CLOUDFLARE_ACCOUNT_ID}}
# cloudflare_namespace_id: ${{secrets.CLOUDFLARE_NAMESPACE_ID}}
# cloudflare_token: ${{secrets.CLOUDFLARE_TOKEN}}
- name: Show Outputs
run: echo "Outputs issue_number '${{ steps.update-slug.outputs.issue_number }}' Slug '${{ steps.update-slug.outputs.slug }}'"
# - name: Link check (critical, all files)
# run: |
# ./.github/scripts/slugify.js \
# --${{ steps.get-issue.outputs.issue-title }}
# - name: Value
# run: echo "${{ steps.cloudflare_kv.outputs.value }}"
# - name: cloudflare-kv-action
# uses: zentered/[email protected]
# id: cloudflare_kv
# env:
# CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_TOKEN }}
# # CLOUDFLARE_ACCOUNT_EMAIL: ${{ secrets.CLOUDFLARE_ACCOUNT_EMAIL }}
# CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# with:
# namespace_identifier: ${{secrets.CLOUDFLARE_NAMESPACE_ID}}
# key_name: ${{ steps.update-slug.outputs.slug }}
# value: '${{ steps.update-slug.outputs.issue_number }}'
# - name: New Value
# run: echo "${{ steps.cloudflare_kv.outputs.value }}"
- name: Revalidate link (via curl / on-demand revalidation)
run: |
curl -X GET "https://www.philbassham.com/api/revalidate?secret=${{secrets.REVALIDATE_TOKEN}}&slug=${{steps.update-slug.outputs.slug}}"