From 968ff61d99fc8c8dd1f8376a08872b7139435fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20T=C3=BCrken?= Date: Wed, 1 Mar 2023 14:54:12 +0300 Subject: [PATCH] Add provider-tag, provider-backport and provider-commands yml files to github workflows --- .github/workflows/provider-backport.yml | 27 +++++++++++++++++++++ .github/workflows/provider-commands.yml | 32 +++++++++++++++++++++++++ .github/workflows/provider-tag.yml | 28 ++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 .github/workflows/provider-backport.yml create mode 100644 .github/workflows/provider-commands.yml create mode 100644 .github/workflows/provider-tag.yml diff --git a/.github/workflows/provider-backport.yml b/.github/workflows/provider-backport.yml new file mode 100644 index 0000000..4412ead --- /dev/null +++ b/.github/workflows/provider-backport.yml @@ -0,0 +1,27 @@ +name: Backport + +on: + workflow_call: + +jobs: + # NOTE(negz): I tested many backport GitHub actions before landing on this + # one. Many do not support merge commits, or do not support pull requests with + # more than one commit. This one does. It also handily links backport PRs with + # new PRs, and provides commentary and instructions when it can't backport. + # The main gotchas with this action are that it _only_ supports merge commits, + # and that PRs _must_ be labelled before they're merged to trigger a backport. + open-pr: + runs-on: ubuntu-22.04 + if: github.event.pull_request.merged + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Open Backport PR + uses: zeebe-io/backport-action@v0.0.8 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + github_workspace: ${{ github.workspace }} + version: v0.0.8 diff --git a/.github/workflows/provider-commands.yml b/.github/workflows/provider-commands.yml new file mode 100644 index 0000000..5591393 --- /dev/null +++ b/.github/workflows/provider-commands.yml @@ -0,0 +1,32 @@ +name: Comment Commands + +on: + workflow_call: + +jobs: + backport: + runs-on: ubuntu-22.04 + if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/backport') + steps: + - name: Extract Command + id: command + uses: xt0rted/slash-command-action@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + command: backport + reaction: "true" + reaction-type: "eyes" + allow-edits: "false" + permission-level: write + + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Open Backport PR + uses: zeebe-io/backport-action@v0.0.4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + github_workspace: ${{ github.workspace }} + version: v0.0.4 diff --git a/.github/workflows/provider-tag.yml b/.github/workflows/provider-tag.yml new file mode 100644 index 0000000..0642d41 --- /dev/null +++ b/.github/workflows/provider-tag.yml @@ -0,0 +1,28 @@ +name: Tag + +on: + workflow_call: + inputs: + version: + description: 'Release version (e.g. v0.1.0)' + required: true + type: string + message: + description: 'Tag message' + required: true + type: string + +jobs: + create-tag: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Create Tag + uses: negz/create-tag@v1 + with: + version: ${{ inputs.version }} + message: ${{ inputs.message }} + token: ${{ secrets.GITHUB_TOKEN }}