Skip to content

Commit

Permalink
Restructure Release Drafter Flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Maffooch committed Jan 16, 2024
1 parent edf870f commit ceb9cf0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/fetch-oas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ name: Fetch OpenAPI Specifications

on:
workflow_call:
inputs:
version:
type: string
description: |
The version to be associated with the GitHub release that's created or updated.
This will override any version calculated by the release-drafter.
required: false

jobs:

Check warning on line 13 in .github/workflows/fetch-oas.yml

View check run for this annotation

DryRunSecurity / AI-powered Sensitive Function Check

Possible Sensitive Function

Our AI-Powered Sensitive Function checker believes it has discovered a sensitive function being modified in this PR. The name of the function is `authenticate_user`. Extra care must be taken when modifying a function that is potentially security-sensitive. The following reason was provided for why this function was flagged as sensitive: This function is authentication related as it mentions authenticating a user.
oas_fetch:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release-2-tag-docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,10 @@ jobs:
with:
release_number: ${{ github.event.inputs.release_number }}
secrets: inherit

release-drafter:
needs: release-docker-containers
uses: ./.github/workflows/release-drafter.yml
with:
version: ${{ github.event.inputs.release_number }}
secrets: inherit

Check warning on line 55 in .github/workflows/release-2-tag-docker-push.yml

View check run for this annotation

DryRunSecurity / AI-powered Sensitive Function Check

Possible Sensitive Function

Our AI-Powered Sensitive Function checker believes it has discovered a sensitive function being modified in this PR. The name of the function is `authenticate_token`. Extra care must be taken when modifying a function that is potentially security-sensitive. The following reason was provided for why this function was flagged as sensitive: This function is authentication related as it authenticates a token.
34 changes: 20 additions & 14 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
name: Release Drafter

on:
workflow_dispatch:
workflow_call:
inputs:
version:
type: string
description: |
The version to be associated with the GitHub release that's created or updated.
This will override any version calculated by the release-drafter.
required: false

push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
oas-fetch:
uses: ./.github/workflows/fetch-oas.yml
secrets: inherit

# Update the notes in the release drafter first
# If the following jobs fail, then we will at least have some release notes present
update_release_draft:
needs: oas-fetch
runs-on: ubuntu-latest
steps:
- name: Load OAS files from artifacts
uses: actions/download-artifact@v3

- name: Create Release
id: create_release
uses: release-drafter/[email protected]
with:
version: ${{github.event.inputs.version}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Generate the OAS schemas in another workflow
oas-fetch:
needs: update_release_draft
uses: ./.github/workflows/fetch-oas.yml
with:
version: ${{github.event.inputs.version}}
secrets: inherit
# Upload the OAS schemas to the release object
add-oas-to-release:
needs: oas-fetch
runs-on: ubuntu-latest
steps:
- name: Load OAS files from artifacts
uses: actions/download-artifact@v3

- name: Upload Release Asset - OpenAPI Specification - YAML
id: upload-release-asset-yaml
Expand All @@ -55,3 +59,5 @@ jobs:
asset_path: ./oas-json/oas.json
asset_name: oas.json
asset_content_type: application/json


0 comments on commit ceb9cf0

Please sign in to comment.