Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix sed command in check-go-versions.yml #117

Merged
merged 3 commits into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/check-go-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- name: Parse officially supported Go versions
id: parse
run: |
echo "latest=${{ fromJSON(env.fetch-api-data)[0].latest }}" >> $GITHUB_OUTPUT
echo "penultimate=${{ fromJSON(env.fetch-api-data)[1].latest }}" >> $GITHUB_OUTPUT
Copy link
Contributor Author

@cwaldren-ld cwaldren-ld Mar 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using the full Go versions (like 1.22.1), just grab only the "cycle" (1.22). This is what we want in the docs and in the go.mod.

echo "latest=${{ fromJSON(env.fetch-api-data)[0].cycle }}" >> $GITHUB_OUTPUT
echo "penultimate=${{ fromJSON(env.fetch-api-data)[1].cycle }}" >> $GITHUB_OUTPUT


create-prs:
Expand Down Expand Up @@ -55,10 +55,11 @@ jobs:
if: steps.go-versions.outputs.latest != env.officialLatestVersion
id: update-go-versions
run: |
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
sed -i -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'
Expand Down
Loading