Copilot commented on code in PR #16239: URL: https://github.com/apache/grails-core/pull/16239#discussion_r3881817478
########## .github/workflows/forge-deploy-aws.yml: ########## @@ -0,0 +1,330 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# GitHub registers workflow_dispatch from the default branch. Dispatch from that +# branch and set source_ref to the maintenance line or tag to build. The job +# reads javaVersion from gradle.properties. OIDC trusts refs/heads/*.x and +# refs/tags/v* in apache/grails-core, so new version branches need no template edit. + +name: "Forge - AWS Elastic Beanstalk Deploy" +run-name: "Forge AWS ${{ inputs.slot }} ${{ inputs.source_ref || github.ref_name }}${{ inputs.release && format(' - {0}', inputs.release) || '' }}" + +on: + workflow_dispatch: + inputs: + slot: + description: 'Deployment slot' + required: true + type: choice + options: + - latest + - snapshot + - next + - prev + - prev-snapshot + source_ref: + description: 'Git branch or tag to build. Leave empty to build the workflow ref.' + required: false + type: string Review Comment: `source_ref` is documented as optional, but if it is omitted the workflow sets `SOURCE_REF` to `github.ref_name` (typically the default branch), and then immediately fails validation because it only permits `*.x` branches or `v*` tags. Make `source_ref` required (and adjust the description accordingly), or update the validation + role trust expectations to genuinely support building/deploying from the workflow ref. ########## .github/workflows/forge-deploy-aws.yml: ########## @@ -0,0 +1,330 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# GitHub registers workflow_dispatch from the default branch. Dispatch from that +# branch and set source_ref to the maintenance line or tag to build. The job +# reads javaVersion from gradle.properties. OIDC trusts refs/heads/*.x and +# refs/tags/v* in apache/grails-core, so new version branches need no template edit. + +name: "Forge - AWS Elastic Beanstalk Deploy" +run-name: "Forge AWS ${{ inputs.slot }} ${{ inputs.source_ref || github.ref_name }}${{ inputs.release && format(' - {0}', inputs.release) || '' }}" + +on: + workflow_dispatch: + inputs: + slot: + description: 'Deployment slot' + required: true + type: choice + options: + - latest + - snapshot + - next + - prev + - prev-snapshot + source_ref: + description: 'Git branch or tag to build. Leave empty to build the workflow ref.' + required: false + type: string + release: + description: 'Optional release identifier for the deployment label' + required: false + type: string + shared_stack: + description: 'CloudFormation stack exporting Forge deployment resources' + default: grails-forge-shared + required: false + type: string + aws_region: + description: 'AWS region containing the shared stack and Elastic Beanstalk application' + default: us-east-1 + required: false + type: string + +permissions: + contents: read + id-token: write + +concurrency: + group: forge-aws-deploy-${{ inputs.slot }} + cancel-in-progress: false + +jobs: + deploy: + name: "Deploy ${{ inputs.slot }} to AWS Elastic Beanstalk" + runs-on: ubuntu-24.04 + timeout-minutes: 75 + env: + AWS_REGION: ${{ inputs.aws_region }} + AWS_DEFAULT_REGION: ${{ inputs.aws_region }} + AWS_PAGER: "" + DEPLOY_ROLE_ARN: ${{ vars.AWS_FORGE_DEPLOY_ROLE_ARN }} + RELEASE: ${{ inputs.release }} + SHARED_STACK: ${{ inputs.shared_stack }} + SLOT: ${{ inputs.slot }} + SOURCE_REF: ${{ inputs.source_ref || github.ref_name }} + steps: + - name: "Validate source ref" + shell: bash + run: | + set -euo pipefail + if [[ "${SOURCE_REF}" =~ ^[0-9]+\.[0-9]+\.x$ ]]; then + exit 0 + fi + if [[ "${SOURCE_REF}" =~ ^v[0-9][A-Za-z0-9._-]*$ ]]; then + exit 0 + fi + echo "source_ref must be a maintenance branch such as 7.1.x or a tag such as v7.1.6." >&2 + exit 1 Review Comment: `source_ref` is documented as optional, but if it is omitted the workflow sets `SOURCE_REF` to `github.ref_name` (typically the default branch), and then immediately fails validation because it only permits `*.x` branches or `v*` tags. Make `source_ref` required (and adjust the description accordingly), or update the validation + role trust expectations to genuinely support building/deploying from the workflow ref. ########## .github/workflows/forge-deploy-aws.yml: ########## @@ -0,0 +1,330 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# GitHub registers workflow_dispatch from the default branch. Dispatch from that +# branch and set source_ref to the maintenance line or tag to build. The job +# reads javaVersion from gradle.properties. OIDC trusts refs/heads/*.x and +# refs/tags/v* in apache/grails-core, so new version branches need no template edit. + +name: "Forge - AWS Elastic Beanstalk Deploy" +run-name: "Forge AWS ${{ inputs.slot }} ${{ inputs.source_ref || github.ref_name }}${{ inputs.release && format(' - {0}', inputs.release) || '' }}" + +on: + workflow_dispatch: + inputs: + slot: + description: 'Deployment slot' + required: true + type: choice + options: + - latest + - snapshot + - next + - prev + - prev-snapshot + source_ref: + description: 'Git branch or tag to build. Leave empty to build the workflow ref.' + required: false + type: string + release: + description: 'Optional release identifier for the deployment label' + required: false + type: string + shared_stack: + description: 'CloudFormation stack exporting Forge deployment resources' + default: grails-forge-shared + required: false + type: string + aws_region: + description: 'AWS region containing the shared stack and Elastic Beanstalk application' + default: us-east-1 + required: false + type: string + +permissions: + contents: read + id-token: write + +concurrency: + group: forge-aws-deploy-${{ inputs.slot }} + cancel-in-progress: false + +jobs: + deploy: + name: "Deploy ${{ inputs.slot }} to AWS Elastic Beanstalk" + runs-on: ubuntu-24.04 + timeout-minutes: 75 + env: + AWS_REGION: ${{ inputs.aws_region }} + AWS_DEFAULT_REGION: ${{ inputs.aws_region }} + AWS_PAGER: "" + DEPLOY_ROLE_ARN: ${{ vars.AWS_FORGE_DEPLOY_ROLE_ARN }} + RELEASE: ${{ inputs.release }} + SHARED_STACK: ${{ inputs.shared_stack }} + SLOT: ${{ inputs.slot }} + SOURCE_REF: ${{ inputs.source_ref || github.ref_name }} Review Comment: `source_ref` is documented as optional, but if it is omitted the workflow sets `SOURCE_REF` to `github.ref_name` (typically the default branch), and then immediately fails validation because it only permits `*.x` branches or `v*` tags. Make `source_ref` required (and adjust the description accordingly), or update the validation + role trust expectations to genuinely support building/deploying from the workflow ref. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
