-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
break workflows into actions and smaller workflows, reuse workflows i…
…n larger workflows
- Loading branch information
1 parent
2593199
commit 8f7b47d
Showing
25 changed files
with
887 additions
and
722 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: "Audit changelog" | ||
description: "Get metadata about a changelog, including the expected file path, and if it exists" | ||
|
||
inputs: | ||
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 }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- 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: 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 }} |
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
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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "Audit GitHub team" | ||
description: "Get metadata about a GitHub team, such as a list of team members" | ||
|
||
inputs: | ||
organization: | ||
description: "The GitHub organization that owns the team" | ||
required: true | ||
team: | ||
description: "The name of the team" | ||
required: true | ||
|
||
outputs: | ||
members: | ||
description: "A space delimited list of team members" | ||
value: ${{ steps.members.outputs.membership }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: "Set: output file name" | ||
id: output-file | ||
run: echo "name=output_$GITHUB_RUN_ID.json" >> $GITHUB_OUTPUT | ||
|
||
- name: "Get team membership for `${{ inputs.organization }}/${{ inputs.team }}`" | ||
run: | | ||
url = orgs/${{ inputs.organization }}/teams/${{ inputs.team }}/members | ||
header = Accept: application/vnd.github+json | ||
gh api -H "$header" $url > ${{ steps.output-file.outputs.name }} | ||
- name: "Parse team membership" | ||
id: members | ||
shell: | ||
run: | | ||
team_list=$(jq -r '.[].login' ${{ steps.output-file.outputs.name }}) | ||
team_list_single=$(echo $team_list | tr '\n' ' ') | ||
echo "membership=$team_list_single" >> $GITHUB_OUTPUT | ||
- name: "[DEBUG] Parse team membership" | ||
shell: bash | ||
run: | | ||
echo organization : ${{ inputs.organization }} | ||
echo team : ${{ inputs.team }} | ||
echo members : ${{ steps.members.outputs.membership }} | ||
- name: "Delete the output file" | ||
run: rm ${{ steps.output-file.outputs.name }} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "Commit changes" | ||
description: "Commit changes and push back up to the remote" | ||
|
||
inputs: | ||
message: | ||
description: "The commit message" | ||
required: true | ||
user: | ||
description: "The user for the commit" | ||
default: "Github Build Bot" | ||
email: | ||
description: "The email for the commit" | ||
default: "[email protected]" | ||
|
||
outputs: | ||
path: | ||
description: "The file path to the change log, relative to the repo root" | ||
value: ${{ steps.path.outputs.path }} | ||
exists: | ||
description: "Does the changelog exist?" | ||
value: ${{ steps.exists.outputs.exists }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: "Commit and push changes" | ||
shell: bash | ||
run: | | ||
git config user.name "${{ inputs.user }}" | ||
git config user.email "${{ inputs.email }}" | ||
git pull | ||
git add . | ||
git commit -m "${{ inputs.message }}" | ||
git push |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: "Create temp branch" | ||
description: "Create a unique temporary branch for running CI workflows, such as version bumps, changelog consolidation, etc." | ||
|
||
inputs: | ||
branch-stub: | ||
description: "Stub to use for naming the branch (e.g. prep-release/, nightly-release/, etc.)" | ||
default: "temp/" | ||
|
||
outputs: | ||
branch: | ||
description: "Name of the newly created branch" | ||
value: ${{ steps.branch.outputs.branch-name }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: "Create a unique branch name" | ||
id: branch | ||
run: | | ||
name="${{ inputs.branch-stub }}" | ||
name+="$(date +'%Y-%m-%d')/$GITHUB_RUN_ID" | ||
echo "branch-name=$name" >> $GITHUB_OUTPUT | ||
- name: "Create branch: `${{ steps.branch.outputs.branch-name }}`" | ||
shell: bash | ||
run: | | ||
git checkout -b ${{ steps.branch.outputs.branch-name }} | ||
git push -u origin ${{ steps.branch.outputs.branch-name }} | ||
- name: "[INFO] Created branch" | ||
shell: bash | ||
run: | | ||
title="Created branch" | ||
message="${{ steps.branch.outputs.branch-name }}" | ||
echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" |
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: "Setup `changie`" | ||
description: "Setup `changie` using `linuxbrew`" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: "Add `linuxbrew` to PATH" | ||
shell: bash | ||
run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH | ||
|
||
- name: "Install `linuxbrew` packages" | ||
shell: bash | ||
run: | | ||
brew install pre-commit | ||
brew tap miniscruff/changie https://github.com/miniscruff/changie | ||
brew install changie |
Oops, something went wrong.