You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/09/14 12:02:05 UTC
[GitHub] [airflow] ashb commented on a change in pull request #10912: Fixes retrieval of correct branch in non-master related builds
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:
users@infra.apache.org