Add success flags to workflows

This commit is contained in:
Luke Tainton 2024-07-16 19:02:55 +01:00
parent 9f93c0846d
commit e98e11d963
No known key found for this signature in database
2 changed files with 18 additions and 0 deletions

View File

@ -6,6 +6,10 @@ on:
release:
required: true
type: string
outputs:
success:
description: "Did the flow succeed?"
value: ${{ jobs.publish.outputs.success }}
jobs:
publish:
@ -16,6 +20,8 @@ jobs:
contents: read
attestations: write
id-token: write
outputs:
success: ${{ steps.set_flag.outputs.success }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
@ -58,3 +64,7 @@ jobs:
subject-name: ghcr.io/${{ github.repository }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
- name: Set success flag
id: set_flag
run: echo "success=true" >> "$GITHUB_OUTPUT"

View File

@ -5,6 +5,9 @@ on:
release_name:
description: "Name of the created release"
value: ${{ jobs.create_release.outputs.release_name }}
success:
description: "Was the release created successfully?"
value: ${{ jobs.create_release.outputs.success }}
jobs:
create_release:
@ -12,6 +15,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
release_name: ${{ steps.tag_version.outputs.new_tag }}
success: ${{ steps.set_flag.outputs.success }}
steps:
- uses: actions/checkout@v4
with:
@ -41,3 +45,7 @@ jobs:
name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
generateReleaseNotes: true
- name: Set success flag
id: set_flag
run: echo "success=true" >> "$GITHUB_OUTPUT"