Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Commit

Permalink
Retrieving Github env vars
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Oswalt <[email protected]>
  • Loading branch information
Mierdin committed Mar 17, 2021
1 parent 7e46cf3 commit e2bea45
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,39 @@ jobs:
# ----------------------------------------


- name: Dispatch to other repo
id: preview_dispatch
- name: Create Preview
id: create_preview
run: |
curl -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/nre-learning/previews/dispatches -d '{"event_type":"preview_image_build"}'
echo ::set-output name=preview_id::$(./create-preview.sh | jq -r '.ID')
# GITHUB_SHA is the id of the merge commit on the PR branch.

- name: Build Preview Images
id: build_preview_images
run: |
echo $PREVIEW_ID && echo $GITHUB_REF && echo $PREVIEW_GIT_REF && echo $PREVIEW_CURRICULUM_REPO
env:
PREVIEW_ID: ${{ steps.create_preview.outputs.preview_id }}
# PREVIEW_ID: ${{needs.prebuild.outputs.preview_id}}
PREVIEW_GIT_REF: ${{ github.event.pull_request.head.sha || github.sha }}
# echo ${{ github.event.pull_request.head.sha }}
PREVIEW_BRANCH: ""
PREVIEW_CURRICULUM_REPO: ""
# TODO - pass token in here vs using your own personal token, just like wait for check action does
# (I believe this github token is passed even for PRs)


# https://github.com/marketplace/actions/wait-for-check
# - name: Wait for build to succeed
# uses: fountainhead/[email protected]
# id: wait-for-build
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# checkName: build
# ref: ${{ github.event.pull_request.head.sha || github.sha }}


# #///////////////////////

# - name: Create Preview
# id: create_preview
# run: |
# echo ::set-output name=preview_id::$(./create-preview.sh | jq -r '.ID')

# - name: Get Buildables
# id: get_buildables
# run: |
Expand Down

0 comments on commit e2bea45

Please sign in to comment.