Skip to content

Commit 3836f11

Browse files
author
Sean Sundberg
authored
Pipeline updates (#101)
- Only run the verification process on a PR, not on push to master - Release using TOKEN instead of GITHUB_TOKEN so that events can trigger downstream processes - Adds notify pipeline to trigger a repository dispatch event on the cloudnative-toolkit repo - Create a draft PR instead of auto-publishing
1 parent 7bb1afb commit 3836f11

File tree

3 files changed

+41
-20
lines changed

3 files changed

+41
-20
lines changed

.github/workflows/notify.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Notify
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
notify:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
slug: ["ibm-garage-cloud/cloudnative-toolkit"]
14+
15+
steps:
16+
- name: Repository dispatch ${{matrix.slug}}
17+
run: |
18+
curl -XPOST -u "${{ secrets.USERNAME}}:${{secrets.TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/${{matrix.slug}}/dispatches --data '{"event_type": "released"}'

.github/workflows/release.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the master branch
5+
on:
6+
push:
7+
branches: [ master ]
8+
9+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
14+
# Steps represent a sequence of tasks that will be executed as part of the job
15+
steps:
16+
# Drafts your next Release notes as Pull Requests are merged into "master"
17+
- uses: release-drafter/release-drafter@v5
18+
with:
19+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
20+
config-name: release-drafter.yaml
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.TOKEN }}

.github/workflows/verify.yaml renamed to .github/workflows/verify-pr.yaml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
name: Verify and release
1+
name: Verify PR
22

33
# Controls when the action will run. Triggers the workflow on push or pull request
44
# events but only for the master branch
55
on:
6-
push:
7-
branches: [ master ]
86
pull_request:
97
branches: [ master ]
108

@@ -89,20 +87,3 @@ jobs:
8987
# diff $PWD/cluster-state/before $PWD/cluster-state/after
9088
# exit 1
9189
# fi
92-
93-
release:
94-
# if: ${{ github.event_name == 'push' }}
95-
needs: verify
96-
runs-on: ubuntu-latest
97-
if: ${{ github.event_name == 'push' }}
98-
99-
# Steps represent a sequence of tasks that will be executed as part of the job
100-
steps:
101-
# Drafts your next Release notes as Pull Requests are merged into "master"
102-
- uses: release-drafter/release-drafter@v5
103-
with:
104-
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
105-
config-name: release-drafter.yaml
106-
publish: true
107-
env:
108-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)