Skip to content

Commit

Permalink
Align files (#66)
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 Apr 4, 2023
1 parent dd58038 commit 27fbe42
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 26 deletions.
18 changes: 9 additions & 9 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.19.0
# devctl@5.21.0
#
name: Create Release
on:
Expand Down Expand Up @@ -122,22 +122,22 @@ jobs:
fi
- name: Set up git identity
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config --local user.email "[email protected]"
git config --local user.name "taylorbot"
- name: Commit changes
run: |
file="${{ needs.gather_facts.outputs.project_go_path }}"
git add $file
git commit -m "Bump version to ${{ steps.update_project_go.outputs.new_version }}"
- name: Push changes
env:
REMOTE_REPO: "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
REMOTE_REPO: "https://${{ github.actor }}:${{ secrets.TAYLORBOT_GITHUB_ACTION }}@github.com/${{ github.repository }}.git"
branch: "${{ github.ref }}-version-bump"
run: |
git push "${REMOTE_REPO}" HEAD:${{ env.branch }}
- name: Create PR
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.TAYLORBOT_GITHUB_ACTION }}"
base: "${{ github.ref }}"
branch: "${{ github.ref }}-version-bump"
version: "${{ needs.gather_facts.outputs.version }}"
Expand Down Expand Up @@ -171,22 +171,22 @@ jobs:
path: ./CHANGELOG.md
- name: Set up git identity
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config --local user.email "[email protected]"
git config --local user.name "taylorbot"
- name: Create tag
run: |
version="${{ needs.gather_facts.outputs.version }}"
git tag "v$version" ${{ github.sha }}
- name: Push tag
env:
REMOTE_REPO: "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
REMOTE_REPO: "https://${{ github.actor }}:${{ secrets.TAYLORBOT_GITHUB_ACTION }}@github.com/${{ github.repository }}.git"
run: |
git push "${REMOTE_REPO}" --tags
- name: Create release
id: create_gh_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: "${{ secrets.TAYLORBOT_GITHUB_ACTION }}"
with:
body: ${{ steps.changelog_reader.outputs.changes }}
tag_name: "v${{ needs.gather_facts.outputs.version }}"
Expand Down
32 changes: 18 additions & 14 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.19.0
# devctl@5.21.0
#
name: Create Release PR
on:
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
repo_name: ${{ steps.gather_facts.outputs.repo_name }}
branch: ${{ steps.gather_facts.outputs.branch }}
base: ${{ steps.gather_facts.outputs.base }}
is_major: ${{ steps.gather_facts.outputs.is_major }}
needs_major_bump: ${{ steps.gather_facts.outputs.needs_major_bump }}
skip: ${{ steps.pr_exists.outputs.skip }}
version: ${{ steps.gather_facts.outputs.version }}
steps:
Expand All @@ -65,7 +65,7 @@ jobs:
version="$(echo $head | awk -F# '{print $NF}')"
if [[ $version =~ ^major|minor|patch$ ]]; then
gh auth login --with-token <<<$(echo -n ${{ secrets.GITHUB_TOKEN }})
gh auth login --with-token <<<$(echo -n ${{ secrets.TAYLORBOT_GITHUB_ACTION }})
gh_api_get_latest_release_version()
{
if ! version="$(gh api "repos/$1/releases/latest" --jq '.tag_name[1:] | split(".") | .[0], .[1], .[2]')"
Expand Down Expand Up @@ -94,7 +94,9 @@ jobs:
version_major=$((version_major+1))
version_minor=0
version_patch=0
echo "is_major=true" >> $GITHUB_OUTPUT
if [[ "${version_major}" != "1" ]]; then
echo "needs_major_bump=true" >> $GITHUB_OUTPUT
fi
;;
*)
echo "Unknown Semver level provided"
Expand All @@ -109,8 +111,8 @@ jobs:
version_patch=$(echo "${version}" | cut -d "." -f 3)
# 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 "is_major=true" >> $GITHUB_OUTPUT
if [[ $version_minor = 0 && $version_patch =~ ^0.* && $version_major != 1 ]]; then
echo "needs_major_bump=true" >> $GITHUB_OUTPUT
fi
fi
repo_name="$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')"
Expand All @@ -122,10 +124,12 @@ jobs:
- name: Check if PR exists
id: pr_exists
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.TAYLORBOT_GITHUB_ACTION }}"
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 }}
head="${{ steps.gather_facts.outputs.branch }}"
branch="${head#refs/heads/}" # Strip "refs/heads/" prefix.
if gh pr view --repo "${{ github.repository }}" "${branch}" --json state --jq .state | grep -i 'open' > /dev/null; then
gh pr view --repo "${{ github.repository }}" "${branch}"
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "skip=false" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -198,14 +202,14 @@ jobs:
- name: Bump go module defined in go.mod if needed
run: |
if [ "${{ needs.gather_facts.outputs.is_major }}" = true ] && test -f "go.mod"; then
if [ "${{ needs.gather_facts.outputs.needs_major_bump }}" = true ] && test -f "go.mod"; then
go install github.com/marwan-at-work/mod/cmd/[email protected]
mod upgrade
fi
- name: Set up git identity
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config --local user.email "[email protected]"
git config --local user.name "taylorbot"
- name: Create release commit
env:
version: "${{ needs.gather_facts.outputs.version }}"
Expand All @@ -214,12 +218,12 @@ jobs:
git commit -m "Release v${{ env.version }}"
- name: Push changes
env:
remote_repo: "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
remote_repo: "https://${{ github.actor }}:${{ secrets.TAYLORBOT_GITHUB_ACTION }}@github.com/${{ github.repository }}.git"
run: |
git push "${remote_repo}" HEAD:${{ needs.gather_facts.outputs.branch }}
- name: Create PR
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.TAYLORBOT_GITHUB_ACTION }}"
base: "${{ needs.gather_facts.outputs.base }}"
version: "${{ needs.gather_facts.outputs.version }}"
run: |
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.19.0
# devctl@5.21.0
#
name: gitleaks

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:

# format Python code with black
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black
language_version: python3
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.19.0
# devctl@5.21.0
#

include Makefile.*.mk
Expand Down
8 changes: 8 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,13 @@
"zricethezav/gitleaks-action",
"actions/setup-go"
],
"regexManagers": [
{
"fileMatch": ["^helm\\/.+\\/values\\.yaml$"],
"matchStrings": ["repo: (?<depName>.*)\n(\\s)*version: (?<currentValue>.*?)\n"],
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^v(?<version>.*)$"
}
],
"schedule": [ "after 6am on thursday" ]
}

0 comments on commit 27fbe42

Please sign in to comment.