ashb commented on a change in pull request #10912:
URL: https://github.com/apache/airflow/pull/10912#discussion_r487857544



##########
File path: .github/workflows/build-images-workflow-run.yml
##########
@@ -209,6 +209,18 @@ jobs:
         uses: actions/checkout@v2
         with:
           ref: ${{ needs.cancel-workflow-runs.outputs.sourceHeadSha }}
+      - name: "Retrieve DEFAULTS from the _initialization.sh"
+        # We cannot "source" the script here because that would be a security 
problem (we cannot run
+        # any code that comes from the sources coming from the PR. Therefore 
we extract the
+        # DEFAULT_BRANCH and DEFAULT_CONSTRAINTS_BRANCH via custom 
grep/awk/sed commands
+        run: |
+          DEFAULT_BRANCH=$(grep "export DEFAULT_BRANCH" 
scripts/ci/libraries/_initialization.sh | \
+            awk 'BEGIN{FS="="} {print $3}' | sed s'/["}]//g')

Review comment:
       Could be done as a single awk command:
   
   
   ```suggestion
             DEFAULT_BRANCH=$(awk -F= '/export DEFAULT_BRANCH/ {gsub(/"/, "", 
$2); print $2}' \
                 scripts/ci/libraries/_initialization.sh)
   
   ```

##########
File path: .github/workflows/build-images-workflow-run.yml
##########
@@ -209,6 +209,18 @@ jobs:
         uses: actions/checkout@v2
         with:
           ref: ${{ needs.cancel-workflow-runs.outputs.sourceHeadSha }}
+      - name: "Retrieve DEFAULTS from the _initialization.sh"
+        # We cannot "source" the script here because that would be a security 
problem (we cannot run
+        # any code that comes from the sources coming from the PR. Therefore 
we extract the
+        # DEFAULT_BRANCH and DEFAULT_CONSTRAINTS_BRANCH via custom 
grep/awk/sed commands
+        run: |
+          DEFAULT_BRANCH=$(grep "export DEFAULT_BRANCH" 
scripts/ci/libraries/_initialization.sh | \
+            awk 'BEGIN{FS="="} {print $3}' | sed s'/["}]//g')

Review comment:
       Don't you mean $2 to match `export DEFAULT_BRANCH="master"`?




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to