Skip to content

Commit

Permalink
test: action (#11)
Browse files Browse the repository at this point in the history
* test: action
  • Loading branch information
fernandoataoldotcom authored Oct 14, 2023
1 parent 65991bd commit 2a04b0c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/test-action-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,24 @@ jobs:
test_action:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Test GHCR
uses: ./
with:
image_name: "test-github-actions-build-push-containers"
registry: "ghcr.io"
context: "./tests/"
context: "./test-directory/tests/"
target_directory: test-directory

- name: Verify GHCR
run: |
docker pull ghcr.io/${{ github.repository }}/test-github-actions-build-push-containers:latest
docker run ghcr.io/${{ github.repository }}/test-github-actions-build-push-containers:latest
# # Test ECR
# # Test ECR
# - name: Use my action for ECR
# uses: your-username/[email protected]
# with:
Expand Down
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ inputs:
required: false
default: "."

target_directory:
description: 'Directory to clone the repository into.'
required: false
default: "."


# ghcr
github_token:
Expand Down Expand Up @@ -123,7 +128,7 @@ runs:
export TARGET_REF="${TARGET_REF#refs/tags/}"
echo "Current ref is: $TARGET_REF"
git clone --depth=1 --branch="$TARGET_REF" "https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}" .
git clone --depth=1 --branch="$TARGET_REF" "https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}" "${{ inputs.target_directory }}"
echo "Using $(docker -v)"
echo "::endgroup::"
Expand Down

0 comments on commit 2a04b0c

Please sign in to comment.