kennknowles commented on code in PR #26793:
URL: https://github.com/apache/beam/pull/26793#discussion_r1205938811


##########
.github/workflows/cut_release_branch.yml:
##########
@@ -43,13 +43,58 @@ on:
       JENKINS_TOKEN:
         description: API Token for the current Jenkins user. Can be generated 
at https://ci-beam.apache.org/user/<user>/configure
         required: true
+      CREATE_RELEASE_BRANCH:
+        description: Whether to cut the release branch. You shouldnt skip this 
unless it has already been completed successfully (yes/no)
+        required: true
+        default: 'yes'
 
 permissions:
   contents: write
   pull-requests: write
 
 jobs:
+  update_release_branch:
+    runs-on: ubuntu-latest
+    env:
+      RELEASE: ${{ github.event.inputs.RELEASE_VERSION }}
+    steps:
+      - name: Validate Release Version
+        run: |
+          if [[ ${RELEASE} =~ ([0-9]+\.[0-9]+\.[0-9]+) ]]; then
+            echo "RELEASE_VERSION=${BASH_REMATCH[1]}" >> $GITHUB_ENV
+            echo "RELEASE_BRANCH=release-${RELEASE}" >> $GITHUB_ENV
+          else
+            echo "The input for RELEASE does not match a valid format 
[0-9]+\.[0-9]+\.[0-9]+"
+            exit 1
+          fi
+      - name: Check out code
+        uses: actions/checkout@v3
+      - name: Set git config
+        run: |
+          git config user.name $GITHUB_ACTOR
+          git config user.email actions@"$RUNNER_NAME".local
+      - name: Checkout to release branch
+        run: |
+          git checkout -b ${RELEASE_BRANCH}
+          echo "==================Current working 
branch======================="
+          echo ${RELEASE_BRANCH}
+          echo 
"==============================================================="
+      - name: Update release version for dataflow runner
+        run: |
+          sed -i -e "s/'beam-master-.*'/'${RELEASE}'/g" \
+          runners/google-cloud-dataflow-java/build.gradle
+          echo "===============Update release branch as 
following=============="
+          git diff
+          echo 
"==============================================================="
+      - name: Commit and Push to release branch
+        run: |
+          git add runners/google-cloud-dataflow-java/build.gradle
+          git commit -m "Set Dataflow container to release version."
+          git push --set-upstream origin ${RELEASE_BRANCH}
+        if: ${{github.event.inputs.CREATE_RELEASE_BRANCH == 'yes'}}

Review Comment:
   Just checking my understanding - this will run all the prior steps but not 
push it to the repo, because the conditional is just on this step?



-- 
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]

Reply via email to