diff --git a/.github/workflows/zz_generated.create_release.yaml b/.github/workflows/zz_generated.create_release.yaml index 48a1d63..7eaa00c 100644 --- a/.github/workflows/zz_generated.create_release.yaml +++ b/.github/workflows/zz_generated.create_release.yaml @@ -1,6 +1,6 @@ # DO NOT EDIT. Generated with: # -# devctl@5.19.0 +# devctl@5.21.0 # name: Create Release on: @@ -122,8 +122,8 @@ 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 "dev@giantswarm.io" + git config --local user.name "taylorbot" - name: Commit changes run: | file="${{ needs.gather_facts.outputs.project_go_path }}" @@ -131,13 +131,13 @@ jobs: 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 }}" @@ -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 "dev@giantswarm.io" + 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 }}" diff --git a/.github/workflows/zz_generated.create_release_pr.yaml b/.github/workflows/zz_generated.create_release_pr.yaml index 5ad67da..ad9eebb 100644 --- a/.github/workflows/zz_generated.create_release_pr.yaml +++ b/.github/workflows/zz_generated.create_release_pr.yaml @@ -1,6 +1,6 @@ # DO NOT EDIT. Generated with: # -# devctl@5.19.0 +# devctl@5.21.0 # name: Create Release PR on: @@ -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: @@ -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]')" @@ -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" @@ -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}')" @@ -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 @@ -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/mod@v0.4.2 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 "dev@giantswarm.io" + git config --local user.name "taylorbot" - name: Create release commit env: version: "${{ needs.gather_facts.outputs.version }}" @@ -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: | diff --git a/.github/workflows/zz_generated.gitleaks.yaml b/.github/workflows/zz_generated.gitleaks.yaml index 850c6d4..f65021d 100644 --- a/.github/workflows/zz_generated.gitleaks.yaml +++ b/.github/workflows/zz_generated.gitleaks.yaml @@ -1,6 +1,6 @@ # DO NOT EDIT. Generated with: # -# devctl@5.19.0 +# devctl@5.21.0 # name: gitleaks diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 29dfd43..22bc136 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/Makefile b/Makefile index e8d5ef9..e394f2b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # DO NOT EDIT. Generated with: # -# devctl@5.19.0 +# devctl@5.21.0 # include Makefile.*.mk diff --git a/renovate.json b/renovate.json index c7a51de..5224a0c 100644 --- a/renovate.json +++ b/renovate.json @@ -21,5 +21,13 @@ "zricethezav/gitleaks-action", "actions/setup-go" ], + "regexManagers": [ + { + "fileMatch": ["^helm\\/.+\\/values\\.yaml$"], + "matchStrings": ["repo: (?.*)\n(\\s)*version: (?.*?)\n"], + "datasourceTemplate": "github-releases", + "extractVersionTemplate": "^v(?.*)$" + } + ], "schedule": [ "after 6am on thursday" ] }