ktmud commented on a change in pull request #13189:
URL: https://github.com/apache/superset/pull/13189#discussion_r578009821
##########
File path: .github/workflows/docker.yml
##########
@@ -24,3 +24,19 @@ jobs:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
.github/workflows/docker_build_push.sh
+
+ - name: Build ephemeral env image
+ if: github.event_name == 'pull_request'
+ run: |
+ mkdir -p ./build
+ echo ${{ github.sha }} > ./build/SHA
+ echo ${{ github.event.pull_request.number }} > ./build/PR-NUM
+ docker build --target ci -t ${{ github.sha }} -t "pr-${{
github.event.pull_request.number }}" .
+ docker save ${{ github.sha }} | gzip > ./build/${{ github.sha
}}.tar.gz
Review comment:
Will it make sense to save the already built image from previously step
and rely on file names to get both SHA and PR number?
##########
File path: .github/workflows/ephemeral-env.yml
##########
@@ -0,0 +1,174 @@
+name: Ephemeral env workflow
+
+on:
+ issue_comment:
+ types: [created]
+
+jobs:
+ ephemeral_env_comment:
+ if: github.event.issue.pull_request
+ name: Evaluate ephemeral env comment trigger (/testenv)
+ runs-on: ubuntu-latest
+ outputs:
+ slash-command: ${{ steps.eval-body.outputs.result }}
+
+ steps:
+ - name: Debug
+ run: |
+ echo "Comment on PR #${{ github.event.issue.number }} by ${{
github.event.issue.user.login }}, ${{ github.event.comment.author_association
}}"
+ echo "Comment body: ${{ github.event.comment.body }}"
+
+ - name: Eval comment body for /testenv slash command
+ uses: actions/github-script@v3
+ id: eval-body
+ with:
+ result-encoding: string
+ script: |
+ const pattern = /^\/testenv (up|down)/
+ const result = pattern.exec(context.payload.comment.body)
+ return result === null ? 'noop' : result[1]
+
+ - name: Limit to committers
+ if: >
+ steps.eval-body.outputs.result != 'noop' &&
+ github.event.comment.author_association != 'MEMBER' &&
+ github.event.comment.author_association != 'OWNER'
+ uses: actions/github-script@v3
+ with:
+ github-token: ${{secrets.GITHUB_TOKEN}}
+ script: |
+ const errMsg = 'Ephemeral environment creation is currently limited
to committers.'
Review comment:
Maybe add a `@comment_author` here 😉
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]