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