From 513200ff884a926902717f8e1338a6076ba0e84f Mon Sep 17 00:00:00 2001 From: Mogyuchi Date: Sat, 15 Jun 2024 21:37:09 +0900 Subject: [PATCH] ci: repository dispatch --- .github/workflows/debug.yml | 1 + .github/workflows/dispatch-test.yml | 32 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/dispatch-test.yml diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index 1b772daf4..eb5fc8b82 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -65,6 +65,7 @@ on: registry_package: release: repository_dispatch: + types: [debug] # schedule: status: watch: diff --git a/.github/workflows/dispatch-test.yml b/.github/workflows/dispatch-test.yml new file mode 100644 index 000000000..2a42c7371 --- /dev/null +++ b/.github/workflows/dispatch-test.yml @@ -0,0 +1,32 @@ +on: + workflow_dispatch: + inputs: + repoCache: + description: "Reset or disable the cache?" + type: choice + default: enabled + options: + - enabled + - disabled + - reset + +permissions: {} + +jobs: + dispatch: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: 'Create a repository dispatch event' + env: + GH_TOKEN: ${{ github.token }} + REPO: '4m-mazi/gh-test' + CACHE: ${{ inputs.repoCache }} + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "/repos/$REPO/dispatches" \ + -f "event_type=debug" -F "client_payload[repoCache]=$CACHE"