-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: run check-go-versions workflow on v7 and v8 branches (#327)
Currently the automated PRs to update Go versions only runs on the v8 branch (because Github only triggers schedule events for the default branch.) This refactors the workflow with an explicit matrix job so that we can get automated PRs on both branches.
- Loading branch information
1 parent
0f897c8
commit bd87c14
Showing
1 changed file
with
35 additions
and
14 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 |
---|---|---|
|
@@ -5,15 +5,11 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
go-versions: | ||
uses: ./.github/workflows/go-versions.yml | ||
|
||
check-go-eol: | ||
needs: go-versions | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
outputs: | ||
latest: ${{ steps.parse.outputs.latest }} | ||
penultimate: ${{ steps.parse.outputs.penultimate }} | ||
timeout-minutes: 2 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -27,12 +23,36 @@ jobs: | |
debug: true | ||
# Parse the response JSON and insert into environment variables for the next step. | ||
- name: Parse officially supported Go versions | ||
id: parse | ||
run: | | ||
echo "officialLatestVersion=${{ fromJSON(env.fetch-api-data)[0].latest }}" >> $GITHUB_ENV | ||
echo "officialPenultimateVersion=${{ fromJSON(env.fetch-api-data)[1].latest }}" >> $GITHUB_ENV | ||
echo "latest=${{ fromJSON(env.fetch-api-data)[0].latest }}" >> $GITHUB_OUTPUT | ||
echo "penultimate=${{ fromJSON(env.fetch-api-data)[1].latest }}" >> $GITHUB_OUTPUT | ||
create-prs: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
needs: check-go-eol | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
branch: ["v7", "v8"] | ||
fail-fast: false | ||
env: | ||
officialLatestVersion: ${{ needs.check-go-eol.outputs.latest }} | ||
officialPenultimateVersion: ${{ needs.check-go-eol.outputs.penultimate }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ matrix.branch }} | ||
|
||
- name: Get current Go versions | ||
id: go-versions | ||
run: cat ./.github/variables/go-versions.env > $GITHUB_OUTPUT | ||
|
||
- name: Run update script | ||
if: needs.go-versions.outputs.latest != env.officialLatestVersion | ||
if: steps.go-versions.outputs.latest != env.officialLatestVersion | ||
id: update | ||
run: ./scripts/update-go-release-version.sh ${{ env.officialLatestVersion }} ${{ env.officialPenultimateVersion }} \ | ||
|
||
|
@@ -44,11 +64,12 @@ jobs: | |
add-paths: | | ||
Dockerfile | ||
.github/variables/go-versions.env | ||
branch: "launchdarklyreleasebot/update-to-go-${{ env.officialLatestVersion }}" | ||
branch: "launchdarklyreleasebot/update-to-go${{ env.officialLatestVersion }}-${{ matrix.branch }}" | ||
author: "LaunchDarklyReleaseBot <[email protected]>" | ||
committer: "LaunchDarklyReleaseBot <[email protected]>" | ||
labels: ${{ matrix.branch }} | ||
title: "fix(deps): bump supported Go versions to ${{ env.officialLatestVersion }} and ${{ env.officialPenultimateVersion }}" | ||
commit-message: "Bumps from Go ${{ needs.go-versions.outputs.latest }} -> ${{ env.officialLatestVersion }} and ${{ needs.go-versions.outputs.penultimate }} -> ${{ env.officialPenultimateVersion }}." | ||
commit-message: "Bumps from Go ${{ steps.go-versions.outputs.latest }} -> ${{ env.officialLatestVersion }} and ${{ steps.go-versions.outputs.penultimate }} -> ${{ env.officialPenultimateVersion }}." | ||
body: | | ||
It's time to update Relay's supported Go versions, due to a recent upstream Go release. | ||
|
@@ -58,8 +79,8 @@ jobs: | |
| | Current repo configuration | Desired repo configuration | | ||
|-------------|------------------------------------|---------------------------------------------------------------------------------------------------------------------| | ||
| Latest | ${{ needs.go-versions.outputs.latest }} | [${{ env.officialLatestVersion }}](https://go.dev/doc/devel/release#go${{ env.officialLatestVersion }}) | | ||
| Penultimate | ${{ needs.go-versions.outputs.penultimate }}| [${{ env.officialPenultimateVersion }}](https://go.dev/doc/devel/release#go${{ env.officialPenultimateVersion }}) | | ||
| Latest | ${{ steps.go-versions.outputs.latest }} | [${{ env.officialLatestVersion }}](https://go.dev/doc/devel/release#go${{ env.officialLatestVersion }}) | | ||
| Penultimate | ${{ steps.go-versions.outputs.penultimate }}| [${{ env.officialPenultimateVersion }}](https://go.dev/doc/devel/release#go${{ env.officialPenultimateVersion }}) | | ||
This PR's change was generated by running: | ||
|