Skip to content

Commit

Permalink
Fix testing PR from repository fork (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgestagg authored Jun 17, 2024
1 parent 297249f commit 7d947b3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,13 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- name: Short commit SHA
id: short
run: |
SHA="${{github.event.pull_request.head.sha}}${{ github.sha }}"
SHORT_SHA=${SHA:0:7}
echo "sha: $SHORT_SHA"
echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT
- name: Build and publish Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
WEBRCI_SHA=${{ steps.short.outputs.sha }}
WEBRCI_SHA=${{ github.sha }}
MAKE_LIBS_TARGET=all
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,28 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Short commit SHA
id: short
- name: Obtain git ref
id: ref
run: |
SHA="${{github.event.pull_request.head.sha}}${{ github.sha }}"
SHORT_SHA=${SHA:0:7}
echo "sha: $SHORT_SHA"
echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT
if [ ${{ github.event.pull_request.head.sha }} ]; then
REPO="https:/${{ github.event.pull_request.head.repo.full_name }}.git"
SHA="${{ github.event.pull_request.head.sha }}"
else
REPO="https:/${{ github.repository }}.git"
SHA="${{ github.sha }}"
fi
echo "repo: $REPO"
echo "repo=$REPO" >> $GITHUB_OUTPUT
echo "sha: $SHA"
echo "sha=$SHA" >> $GITHUB_OUTPUT
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
build-args: |
WEBRCI_SHA=${{ steps.short.outputs.sha }}
WEBRCI_REPO=${{ steps.ref.outputs.repo }}
WEBRCI_SHA=${{ steps.ref.outputs.sha }}
MAKE_LIBS_TARGET=default
build-nix:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ RUN rig add 4.4.0 --without-pak
RUN /opt/R/current/bin/R -q -e 'install.packages("pak", lib = .Library)'

# Download webR and configure for LLVM flang
RUN git clone https:/r-wasm/webr.git /opt/webr
ARG WEBRCI_REPO="https:/r-wasm/webr.git"
RUN git clone ${WEBRCI_REPO} /opt/webr
WORKDIR /opt/webr
ARG WEBRCI_SHA=HEAD
RUN git checkout ${WEBRCI_SHA}
Expand Down

0 comments on commit 7d947b3

Please sign in to comment.