Skip to content

Commit

Permalink
[ASCII-2501] Fix Go update workflows (#30987)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgimalac authored Nov 12, 2024
1 parent 543ed10 commit c75109e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/buildimages-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ jobs:
- name: Checkout branch
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
persist-credentials: false
# credentials are needed to create the PR at the end of the workflow
persist-credentials: true

- name: Fetch branch
env:
Expand Down Expand Up @@ -89,6 +90,7 @@ jobs:
id: update_build_images
env:
TEST_VERSION_FLAG: ${{ inputs.test_version && '--test' || '--no-test' }}
# INCLUDE_OTEL_MODULES must be used without quotes to be ignored when empty
INCLUDE_OTEL_MODULES: ${{ inputs.include_otel_modules && '--include-otel-modules' || '' }}
CURRENT_GO_VERSION: ${{ steps.current_go_version.outputs.GO_VERSION }}
INPUT_GO_VERSION: ${{ inputs.go_version }}
Expand All @@ -98,7 +100,7 @@ jobs:
inv -e buildimages.update --tag "$IMAGES_ID" "$TEST_VERSION_FLAG"
echo "MESSAGE=Update buildimages ID to $IMAGES_ID" >> $GITHUB_OUTPUT
else
inv -e update-go --image-tag "$IMAGES_ID" "$TEST_VERSION_FLAG" "$INCLUDE_OTEL_MODULES" -v "$INPUT_GO_VERSION"
inv -e update-go --image-tag "$IMAGES_ID" "$TEST_VERSION_FLAG" $INCLUDE_OTEL_MODULES -v "$INPUT_GO_VERSION"
echo "MESSAGE=Update Go version to $INPUT_GO_VERSION" >> $GITHUB_OUTPUT
fi
Expand Down Expand Up @@ -145,6 +147,7 @@ jobs:
IMAGES_ID: ${{ inputs.images_id }}
CURRENT_GO_VERSION: ${{ steps.current_go_version.outputs.GO_VERSION }}
INPUT_GO_VERSION: ${{ inputs.go_version }}
# INPUT_TEST_VERSION must be used without quotes to be ignored when empty
INPUT_TEST_VERSION: ${{ inputs.test_version && '--test' || '' }}
GITHUB_REF: ${{ github.ref }}
run: |
Expand All @@ -154,7 +157,7 @@ jobs:
"$IMAGES_ID" \
"$CURRENT_GO_VERSION" \
"$INPUT_GO_VERSION" \
"$INPUT_TEST_VERSION" > $TMP_PR_BODY_PATH
$INPUT_TEST_VERSION > $TMP_PR_BODY_PATH
# Create the PR
gh pr create \
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/go-update-commenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
# Only run on PR label events (in particular not on every commit)
types: [ labeled ]

permissions: {}
permissions:
# write permissions are needed to create the comment
pull-requests: write

jobs:
old-versions-match:
Expand Down Expand Up @@ -44,7 +46,7 @@ jobs:
run: |
set -euo pipefail
# build the base of the Github URL to the current commit
GITHUB_HEAD_URL="GITHUB_SERVER_URL/$GITHUB_REPOSITORY/blob/$GITHUB_SHA"
GITHUB_HEAD_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/blob/$GITHUB_SHA"
{
echo "matches<<EOF"
echo "Here are potential matches of the former version:"
Expand Down

0 comments on commit c75109e

Please sign in to comment.