Skip to content

Add XOR problem-solving tip #34

Add XOR problem-solving tip

Add XOR problem-solving tip #34

name: Trigger Blog Deploy
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- name: Trigger justinmathew.com rebuild
env:
BLOG_REPO_DISPATCH_TOKEN: ${{ secrets.BLOG_REPO_DISPATCH_TOKEN }}
GITHUB_SHA: ${{ github.sha }}
run: |
if [[ -z "$BLOG_REPO_DISPATCH_TOKEN" ]]; then
echo "::warning::Missing BLOG_REPO_DISPATCH_TOKEN secret. Skipping blog deploy dispatch."
echo "Create a fine-grained GitHub token with access to mathewjustin/justinmathew and Contents: Read and write, then save it as this repo secret."
exit 0
fi
curl --fail-with-body \
-X POST \
-H "Authorization: Bearer ${BLOG_REPO_DISPATCH_TOKEN}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/mathewjustin/justinmathew/dispatches \
-d "{\"event_type\":\"leetcode-patterns-updated\",\"client_payload\":{\"source_repo\":\"${GITHUB_REPOSITORY}\",\"source_sha\":\"${GITHUB_SHA}\"}}"