diff --git a/.github/workflows/check-go-versions.yml b/.github/workflows/check-go-versions.yml index c6e26bf1..debe4b20 100644 --- a/.github/workflows/check-go-versions.yml +++ b/.github/workflows/check-go-versions.yml @@ -51,21 +51,33 @@ jobs: id: go-versions run: cat ./.github/variables/go-versions.env > $GITHUB_OUTPUT - - name: Update go-versions.env + - name: Update go-versions.env and README.md if: steps.go-versions.outputs.latest != env.officialLatestVersion - id: update + id: update-go-versions run: | - sed < ./.github/variables/go-versions.env > updated-versions.tmp - -e "s#latest=[^ ]*#latest=${{ env.officialLatestVersion }}#g" - -e "s#penultimate=[^ ]*#penultimate=${{ env.officialPenultimateVersion }}#g" - mv updated-versions.tmp ./.github/variables/go-versions.env + sed -e "s#latest=[^ ]*#latest=${{ env.officialLatestVersion }}#g" + -e "s#penultimate=[^ ]*#penultimate=${{ env.officialPenultimateVersion }}#g" + ./.github/variables/go-versions.env + sed -i "s/Go version {{ steps.go-versions.outputs.penultimate }}/Go version ${{ env.officialPenultimateVersion }}/g" README.md + + - name: Update go.mod and testservice/go.mod + if: steps.update-go-versions.outcome == 'success' + id: update-go-mod + run: | + go mod edit -go=${{ env.officialPenultimateVersion }} + cd testservice + go mod edit -go=${{ env.officialPenultimateVersion }} - name: Create pull request - if: steps.update.outcome == 'success' + if: steps.update-go-mod.outcome == 'success' uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GITHUB_TOKEN }} - add-paths: .github/variables/go-versions.env + add-paths: | + .github/variables/go-versions.env + README.md + go.mod + testservice/go.mod branch: "launchdarklyreleasebot/update-to-go${{ env.officialLatestVersion }}-${{ matrix.branch }}" author: "LaunchDarklyReleaseBot " committer: "LaunchDarklyReleaseBot "