-
Notifications
You must be signed in to change notification settings - Fork 6
54 lines (48 loc) · 1.7 KB
/
create-compat-stack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Send dispatch for cflinuxfs4-compat release creation
on:
release:
types:
- published
workflow_dispatch:
inputs:
version:
description: 'Version of the cflinuxfs4 stack release a compat stack of (e.g. 1.2.3)'
required: true
jobs:
dispatch:
name: Send dispatch for compat stack creation
runs-on: ubuntu-22.04
steps:
- name: Parse Event
id: event
run: |
version="${{ github.event.inputs.version }}"
if [ -z "${version}" ]; then
version="$(jq -r '.release.tag_name' "${GITHUB_EVENT_PATH}" | sed s/^v//)"
fi
echo "version=${version}" >> "$GITHUB_OUTPUT"
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.CF_BOT_GITHUB_TOKEN }}
repository: cloudfoundry/cflinuxfs4-compat-release
event-type: release-dispatch
client-payload: '{"version": "${{ steps.event.outputs.version }}"}'
failure:
name: Alert on Failure
runs-on: ubuntu-22.04
needs: [dispatch]
if: ${{ always() && needs.dispatch.result == 'failure' }}
steps:
- name: File Failure Alert Issue
uses: paketo-buildpacks/github-config/actions/issue/file@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}
label: "failure"
comment_if_exists: true
issue_title: "Failure: Send Compat Stack Dispatch"
issue_body: |
Compat stack dispatch workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}).
comment_body: |
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}