From 909a5d54d2f74e9647d7eca0dc7f9e711628b3d0 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 28 Oct 2021 10:01:59 -0700 Subject: [PATCH] Add a manual trigger to force CI to bump crate versions I'm curious to try out the full workflow so instead of waiting a few weeks I figured I'd add a manual trigger here too --- .github/workflows/bump-version.yml | 8 ++++++++ ci/force-ci-bump-version.sh | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 ci/force-ci-bump-version.sh diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 1d490201bc..2b4a67df25 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -16,6 +16,14 @@ on: # https://crontab.guru/#0_0_8-14_*_1 - cron: '0 0 8-14 * 1' + # Allow manually triggering this workflow remotely via a curl request, + # described at + # https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event + # + # Note that this can be also triggered by running the script in + # `ci/force-ci-bump-version.sh` + workflow_dispatch: + jobs: bump_version: runs-on: ubuntu-latest diff --git a/ci/force-ci-bump-version.sh b/ci/force-ci-bump-version.sh new file mode 100644 index 0000000000..72aa665ff9 --- /dev/null +++ b/ci/force-ci-bump-version.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +if [ -z "$PERSONAL_ACCESS_TOKEN" ]; then + echo "need to set \$PERSONAL_ACCESS_TOKEN to a github token" + exit 1 +fi + +exec curl --include --request POST \ + https://api.github.com/repos/bytecodealliance/wasmtime/actions/workflows/bump-version.yml/dispatches \ + --header "Authorization: token $PERSONAL_ACCESS_TOKEN" \ + --data @- << EOF +{ + "ref": "main" +} +EOF +