Skip to content

Commit

Permalink
updating flow to include release path
Browse files Browse the repository at this point in the history
  • Loading branch information
enekofb committed Aug 8, 2023
1 parent eeb9048 commit c61ec1c
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 14 deletions.
38 changes: 35 additions & 3 deletions .github/workflows/is3907-release.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: is3907release

on:
pull_request_review:
types:
- submitted
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
release-not-required:
Expand All @@ -21,3 +25,31 @@ jobs:
run: |
version=$(echo ${{ github.event.pull_request.head.ref }} | cut -d'/' -f2)
echo "::set-output name=version::$version"
release:
if: ${{ startsWith(github.event.pull_request.head.ref, 'releases/') }}
runs-on: ubuntu-latest
outputs:
version: ${{ steps.release-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Find release version
id: release-version
run: |
version=$(echo ${{ github.event.pull_request.head.ref }} | cut -d'/' -f2)
echo "::set-output name=version::$version"
- name: Wait on release status check
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \
--header 'authorization: Bearer ${{ secrets.WEAVE_GITOPS_BOT_ACCESS_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state":"success",
"target_url":"https://example.com/build/status",
"description":"The build succeeded!",
"context":"continuous-integration/jenkins"
}'
27 changes: 16 additions & 11 deletions doc/issues-3907.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,32 @@ Therefore, an attempt to merge a release would be blocked until the release does
Acceptance for this solution

```gherkin
Feature:
Scenario: can build non-release branches without changing the flow nor overhead
Feature: can build non-release branches without changing the flow nor overhead
Scenario: current flow
Given a non release pr
When build
Then CI workflow passes
And Release process build passes
Then I could merge
And I could merge
```

Scenario: can build release branches with guardrails

```gherkin
Feature: can build release branches with guardrails
Scenario: add a check to the PR that only gets passed when release goes on
Given a release pr
And CI build check preventing merging
And Release check preventing merging
When build
Then CI workflow passes
And cannot merge it
Then CI workflow passes so CI build check passes
And cannot merge it cause release hasnt happened
When human approves it
Then release process starts
And cannot merge it
When release process ends
And cannot merge it cause release hasnt happened
When release process ends so release check passes
Then can merge it
```
**Scenario: can build non-release branches without changing the flow nor overhead**




Expand Down

0 comments on commit c61ec1c

Please sign in to comment.