From 8fbb9e81f49d16210c03204b0fea87e410121711 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 | 33 +++++++++++++++++++++++++++++ 2 files changed, 34 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..694d9892c --- /dev/null +++ b/.github/workflows/dispatch-test.yml @@ -0,0 +1,33 @@ +on: + workflow_dispatch: + inputs: + repoCache: + description: "Reset or disable the cache?" + type: choice + default: enabled + options: + - enabled + - disabled + - reset + +permissions: {} + +env: + REPO: '4m-mazi/gh-test' + +jobs: + dispatch: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: 'Create a repository dispatch event' + env: + GH_TOKEN: ${{ github.token }} + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + /repos/${{ env.REPO }}/dispatches \ + -f "event_type=debug" -F "client_payload[repoCache]=${{ inputs.repoCache }}"