From cf3977f088178903b67c7b3c112973cbe3e70aed Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Thu, 9 Feb 2023 13:51:24 +1300 Subject: [PATCH] Use the github-script action to call the workflow (#4400) --- .github/workflows/release.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a1a13628f..738bb5a6df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -138,14 +138,18 @@ jobs: runs-on: ubuntu-latest needs: [deploy-docker] steps: - - env: - TOKEN: ${{ secrets.DEPLOY_HA_ADDON_REPO_TOKEN }} - # yamllint disable rule:line-length - run: | - curl \ - -u ":$TOKEN" \ - -X POST \ - -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/esphome/home-assistant-addon/actions/workflows/bump-version.yml/dispatches \ - -d '{"ref":"main","inputs":{"version":"${{ github.event.release.tag_name }}","content":${{ toJSON(github.event.release.body) }}}}' - # yamllint enable rule:line-length + - name: Trigger Workflow + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.DEPLOY_HA_ADDON_REPO_TOKEN }} + script: | + github.rest.actions.createWorkflowDispatch({ + owner: "esphome", + repo: "home-assistant-addon", + workflow_id: "bump-version.yml", + ref: "main", + inputs: { + version: "${{ github.event.release.tag_name }}", + content: "${{ toJSON(github.event.release.body) }}" + } + })