From 2db68822023754c1ea8a2bdaa363d3710f5c8f0b Mon Sep 17 00:00:00 2001 From: AlteredCoder <64792091+AlteredCoder@users.noreply.github.com> Date: Fri, 28 Aug 2020 15:24:10 +0200 Subject: [PATCH] add new workflows to create/delete branch on hub (#193) --- .../workflows/dispatch_create_branch_hub.yaml | 24 +++++++++++++++++++ ...aml => dispatch_create_tag_hub-tests.yaml} | 0 .../workflows/dispatch_delete_branch_hub.yaml | 24 +++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 .github/workflows/dispatch_create_branch_hub.yaml rename .github/workflows/{dispatch_hub-tests.yaml => dispatch_create_tag_hub-tests.yaml} (100%) create mode 100644 .github/workflows/dispatch_delete_branch_hub.yaml diff --git a/.github/workflows/dispatch_create_branch_hub.yaml b/.github/workflows/dispatch_create_branch_hub.yaml new file mode 100644 index 000000000..4da9272dd --- /dev/null +++ b/.github/workflows/dispatch_create_branch_hub.yaml @@ -0,0 +1,24 @@ +name: Dispatch to hub when creating pre-release + +on: + release: + types: prereleased + +jobs: + dispatch: + name: dispatch to hub-tests + runs-on: ubuntu-latest + steps: + - name: Get Latest Release + id: latest_version + uses: abatilo/release-info-action@v1.2.0 + with: + owner: crowdsecurity + repo: crowdsec + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.DISPATCH_TOKEN }} + event-type: create_branch + repository: crowdsecurity/hub + client-payload: '{"version": "${{ steps.latest_version.outputs.latest_tag }}"}' \ No newline at end of file diff --git a/.github/workflows/dispatch_hub-tests.yaml b/.github/workflows/dispatch_create_tag_hub-tests.yaml similarity index 100% rename from .github/workflows/dispatch_hub-tests.yaml rename to .github/workflows/dispatch_create_tag_hub-tests.yaml diff --git a/.github/workflows/dispatch_delete_branch_hub.yaml b/.github/workflows/dispatch_delete_branch_hub.yaml new file mode 100644 index 000000000..48ae9d75d --- /dev/null +++ b/.github/workflows/dispatch_delete_branch_hub.yaml @@ -0,0 +1,24 @@ +name: Dispatch to hub when deleting pre-release + +on: + release: + types: deleted + +jobs: + dispatch: + name: dispatch to hub-tests + runs-on: ubuntu-latest + steps: + - name: Get Latest Release + id: latest_version + uses: abatilo/release-info-action@v1.2.0 + with: + owner: crowdsecurity + repo: crowdsec + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.DISPATCH_TOKEN }} + event-type: delete_branch + repository: crowdsecurity/hub + client-payload: '{"version": "${{ steps.latest_version.outputs.latest_tag }}"}' \ No newline at end of file