Skip to content

Commit

Permalink
Align files (#678)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
architectbot and actions-user authored Jan 17, 2023
1 parent 549bb1d commit 8f95c9d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/zz_generated.add-to-project-board.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
event_label=$(cat $GITHUB_EVENT_PATH | jq -r .label.name | tr '[:upper:]' '[:lower:]')
echo "Issue labelled with: ${event_label}"
BOARD=($(cat ${{steps.download-labels.outputs.download-path}}/labels.yaml | tr '[:upper:]' '[:lower:]' | yq ".${event_label}.projectboard"))
BOARD=($(cat ${{steps.download-labels.outputs.download-path}}/labels.yaml | tr '[:upper:]' '[:lower:]' | yq ".[\"${event_label}\"].projectboard"))
echo "Team board URL: ${BOARD}"
echo "BOARD=${BOARD}" >> $GITHUB_ENV
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/zz_generated.create_release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl@5.10.0
# devctl@5.15.0
#
name: Create Release
on:
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
fi
version="${version#v}" # Strip "v" prefix.
echo "version=\"${version}\""
echo "::set-output name=version::${version}"
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Checkout code
if: ${{ steps.get_version.outputs.version != '' }}
uses: actions/checkout@v3
Expand All @@ -63,7 +63,7 @@ jobs:
path=''
fi
echo "path=\"$path\""
echo "::set-output name=path::${path}"
echo "path=${path}" >> $GITHUB_OUTPUT
- name: Check if reference version
id: ref_version
run: |
Expand All @@ -81,7 +81,7 @@ jobs:
refversion=true
fi
echo "refversion =\"${refversion}\""
echo "::set-output name=refversion::${refversion}"
echo "refversion=${refversion}" >> $GITHUB_OUTPUT
update_project_go:
name: Update project.go
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
version="${{ needs.gather_facts.outputs.version }}"
new_version="$(semver bump patch $version)-dev"
echo "version=\"$version\" new_version=\"$new_version\""
echo "::set-output name=new_version::${new_version}"
echo "new_version=${new_version}" >> $GITHUB_OUTPUT
sed -Ei "s/(version[[:space:]]*=[[:space:]]*)\"${version}\"/\1\"${new_version}\"/" $file
if git diff --exit-code $file ; then
echo "error: no changes in \"$file\"" >&2
Expand Down
34 changes: 23 additions & 11 deletions .github/workflows/zz_generated.create_release_pr.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl@5.10.0
# devctl@5.15.0
#
name: Create Release PR
on:
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
id: gather_facts
run: |
head="${{ inputs.branch || github.event.ref }}"
echo "::set-output name=branch::${head}"
echo "branch=${head}" >> $GITHUB_OUTPUT
head="${head#refs/heads/}" # Strip "refs/heads/" prefix.
if [[ $(echo "$head" | grep -o '#' | wc -l) -gt 1 ]]; then
Expand All @@ -66,7 +66,19 @@ jobs:
version="$(echo $head | awk -F# '{print $NF}')"
if [[ $version =~ ^major|minor|patch$ ]]; then
gh auth login --with-token <<<$(echo -n ${{ secrets.GITHUB_TOKEN }})
version_parts=($(gh api "repos/${{ github.repository }}/releases/latest" --jq '.tag_name[1:] | split(".") | .[0], .[1], .[2]'))
gh_api_get_latest_release_version()
{
if ! version="$(gh api "repos/$1/releases/latest" --jq '.tag_name[1:] | split(".") | .[0], .[1], .[2]')"
then
case "$version" in
*Not\ Found*) echo Assuming v0.0.0, hooray first release! >&2 ; version="0 0 0" ;;
*) version="" ; return 1 ;;
esac
fi
echo "$version"
}
version_parts=($(gh_api_get_latest_release_version "${{ github.repository }}"))
version_major=${version_parts[0]}
version_minor=${version_parts[1]}
version_patch=${version_parts[2]}
Expand All @@ -82,7 +94,7 @@ jobs:
version_major=$((version_major+1))
version_minor=0
version_patch=0
echo "::set-output name=is_major::true"
echo "is_major=true" >> $GITHUB_OUTPUT
;;
*)
echo "Unknown Semver level provided"
Expand All @@ -98,25 +110,25 @@ jobs:
# This will help us detect versions with suffixes as majors, i.e 3.0.0-alpha1.
# Even though it's a pre-release, it's still a major.
if [[ $version_minor = 0 && $version_patch =~ ^0.* ]]; then
echo "::set-output name=is_major::true"
echo "is_major=true" >> $GITHUB_OUTPUT
fi
fi
repo_name="$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')"
echo "repo_name=\"$repo_name\" base=\"$base\" head=\"$head\" version=\"$version\""
echo "::set-output name=repo_name::${repo_name}"
echo "::set-output name=base::${base}"
echo "::set-output name=head::${head}"
echo "::set-output name=version::${version}"
echo "repo_name=${repo_name}" >> $GITHUB_OUTPUT
echo "base=${base}" >> $GITHUB_OUTPUT
echo "head=${head}" >> $GITHUB_OUTPUT
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Check if PR exists
id: pr_exists
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
if gh pr view --repo ${{ github.repository }} ${{ steps.gather_facts.outputs.branch }} | grep -i 'state:[[:space:]]*open' >/dev/null; then
gh pr view --repo ${{ github.repository }} ${{ steps.gather_facts.outputs.branch }}
echo "::set-output name=skip::true"
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "::set-output name=skip::false"
echo "skip=false" >> $GITHUB_OUTPUT
fi
create_release_pr:
name: Create release PR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zz_generated.gitleaks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl@5.10.0
# devctl@5.15.0
#
name: gitleaks

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl@5.10.0
# devctl@5.15.0
#

include Makefile.*.mk
Expand Down

0 comments on commit 8f95c9d

Please sign in to comment.