-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8f48a2
commit 415e2d8
Showing
7 changed files
with
286 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,58 +2,56 @@ name: "Audit changelog" | |
description: "Get metadata about a changelog" | ||
|
||
inputs: | ||
version: | ||
description: "The version whose changelog is being audited" | ||
required: true | ||
version: | ||
description: "The version whose changelog is being audited" | ||
required: true | ||
|
||
outputs: | ||
path: | ||
description: "The expected file path to the change log, relative to the repo root" | ||
value: ${{ steps.path.outputs.path }} | ||
exists: | ||
description: "Indicates if the changelog exists" | ||
value: ${{ steps.exists.outputs.exists }} | ||
path: | ||
description: "The expected file path to the change log, relative to the repo root" | ||
value: ${{ steps.path.outputs.path }} | ||
exists: | ||
description: "Indicates if the changelog exists" | ||
value: ${{ steps.exists.outputs.exists }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: "[DEBUG] Inputs" | ||
shell: bash | ||
run: | | ||
echo version : ${{ inputs.version }} | ||
using: composite | ||
steps: | ||
- name: "[DEBUG] Inputs" | ||
shell: bash | ||
run: | | ||
echo version : ${{ inputs.version }} | ||
- name: "Parse version: `${{ inputs.version }}`" | ||
id: semver | ||
uses: dbt-labs/actions/[email protected] | ||
with: | ||
version: ${{ inputs.version }} | ||
- name: "Parse version: `${{ inputs.version }}`" | ||
id: semver | ||
uses: dbt-labs/actions/[email protected] | ||
with: | ||
version: ${{ inputs.version }} | ||
|
||
- name: "Set: path" | ||
id: path | ||
shell: bash | ||
run: | | ||
path=".changes/${{ steps.semver.outputs.base-version }}" | ||
if [[ ${{ steps.semver.outputs.is-pre-release }} -eq 1 ]] | ||
then | ||
path+="-${{ steps.semver.outputs.pre-release }}" | ||
fi | ||
path+=".md" | ||
echo "path=$path" >> $GITHUB_OUTPUT | ||
- name: "Set: path" | ||
id: path | ||
shell: bash | ||
run: | | ||
path=".changes/${{ steps.semver.outputs.base-version }}" | ||
if [[ ${{ steps.semver.outputs.is-pre-release }} -eq 1 ]]; then | ||
path+="-${{ steps.semver.outputs.pre-release }}" | ||
fi | ||
path+=".md" | ||
echo "path=$path" >> $GITHUB_OUTPUT | ||
- name: "Set: exists" | ||
id: exists | ||
shell: bash | ||
run: | | ||
exists=false | ||
if test -f ${{ steps.path.outputs.path }} | ||
then | ||
exists=true | ||
fi | ||
echo "exists=exists">> $GITHUB_OUTPUT | ||
- name: "Set: exists" | ||
id: exists | ||
shell: bash | ||
run: | | ||
exists=false | ||
if test -f ${{ steps.path.outputs.path }}; then | ||
exists=true | ||
fi | ||
echo "exists=exists">> $GITHUB_OUTPUT | ||
- name: "[DEBUG] Changelog metadata" | ||
shell: bash | ||
run: | | ||
echo version : ${{ inputs.version }} | ||
echo path : ${{ steps.path.outputs.path }} | ||
echo exists : ${{ steps.exists.outputs.exists }} | ||
- name: "[DEBUG] Changelog metadata" | ||
shell: bash | ||
run: | | ||
echo version : ${{ inputs.version }} | ||
echo path : ${{ steps.path.outputs.path }} | ||
echo exists : ${{ steps.exists.outputs.exists }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,47 +2,47 @@ name: "Audit GitHub commit" | |
description: "Get metadata about a commit" | ||
|
||
inputs: | ||
sha: | ||
description: "The commit to audit" | ||
required: true | ||
sha: | ||
description: "The commit to audit" | ||
required: true | ||
|
||
outputs: | ||
tag: | ||
description: "The associated release tag, if the release exists" | ||
value: ${{ steps.commit.outputs.tag_name }} | ||
release-id: | ||
description: "The associated release id, if the release exists" | ||
value: ${{ steps.commit.outputs.id }} | ||
pre-release: | ||
description: "If the associated release exists, is it a pre-release?" | ||
value: ${{ steps.commit.outputs.prerelease }} | ||
commitish: | ||
description: "The associated commitish, if the release exists" | ||
value: ${{ steps.commit.outputs.target_commitish }} | ||
tag: | ||
description: "The associated release tag, if the release exists" | ||
value: ${{ steps.commit.outputs.tag_name }} | ||
release-id: | ||
description: "The associated release id, if the release exists" | ||
value: ${{ steps.commit.outputs.id }} | ||
pre-release: | ||
description: "If the associated release exists, is it a pre-release?" | ||
value: ${{ steps.commit.outputs.prerelease }} | ||
commitish: | ||
description: "The associated commitish, if the release exists" | ||
value: ${{ steps.commit.outputs.target_commitish }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: "[DEBUG] Inputs" | ||
shell: bash | ||
run: | | ||
echo sha : ${{ inputs.sha }} | ||
using: composite | ||
steps: | ||
- name: "[DEBUG] Inputs" | ||
shell: bash | ||
run: | | ||
echo sha : ${{ inputs.sha }} | ||
- name: "Check if a release exists for `${{ inputs.sha }}`" | ||
id: commit | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: cardinalby/[email protected] | ||
with: | ||
commitSha: ${{ inputs.sha }} | ||
doNotFailIfNotFound: true # returns blank outputs when not found instead of error | ||
searchLimit: 15 # Since we only care about recent releases, speed up the process | ||
- name: "Check if a release exists for `${{ inputs.sha }}`" | ||
id: commit | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: cardinalby/[email protected] | ||
with: | ||
commitSha: ${{ inputs.sha }} | ||
doNotFailIfNotFound: true # returns blank outputs when not found instead of error | ||
searchLimit: 15 # Since we only care about recent releases, speed up the process | ||
|
||
- name: "[DEBUG] Commit metadata" | ||
shell: bash | ||
run: | | ||
echo sha : ${{ inputs.sha }} | ||
echo tag : ${{ steps.commit.outputs.tag_name }} | ||
echo release-id : ${{ steps.commit.outputs.id }} | ||
echo pre-release : ${{ steps.commit.outputs.prerelease }} | ||
echo commitish : ${{ steps.commit.outputs.target_commitish }} | ||
- name: "[DEBUG] Commit metadata" | ||
shell: bash | ||
run: | | ||
echo sha : ${{ inputs.sha }} | ||
echo tag : ${{ steps.commit.outputs.tag_name }} | ||
echo release-id : ${{ steps.commit.outputs.id }} | ||
echo pre-release : ${{ steps.commit.outputs.prerelease }} | ||
echo commitish : ${{ steps.commit.outputs.target_commitish }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.