Skip to content

Commit

Permalink
test local action
Browse files Browse the repository at this point in the history
  • Loading branch information
Marat Komarov committed Mar 18, 2021
1 parent 518ad76 commit 474ca56
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
8 changes: 8 additions & 0 deletions .github/actions/opa/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ubuntu:latest

ENV OPA_VERSION 0.27.1
RUN apt-get -y update \
&& apt-get install -y curl \
&& curl -L -o /usr/bin/opa https://github.com/open-policy-agent/opa/releases/download/v${OPA_VERSION}/opa_linux_amd64 2>/dev/null \
&& chmod +x /usr/bin/opa \
&& apt-get -y autoremove && rm -rf /var/lib/apt/lists/*
23 changes: 12 additions & 11 deletions .github/workflows/opa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ jobs:
test-new-style:
runs-on: ubuntu-latest
container:
image: ubuntu:latest # Because it has 'curl'
options: --cpus 1
# container:
# image: ubuntu:latest # Because it has 'curl'
# options: --cpus 1
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install OPA
env:
OPA_VERSION: "0.27.1"
run: |-
apt-get -yq update && apt-get install -yq curl;
curl -L -o /usr/bin/opa https://github.com/open-policy-agent/opa/releases/download/v${OPA_VERSION}/opa_linux_amd64 2>/dev/null;
chmod +x /usr/bin/opa;
# - name: Install OPA
# env:
# OPA_VERSION: "0.27.1"
# run: |-
# apt-get -yq update && apt-get install -yq curl;
# curl -L -o /usr/bin/opa https://github.com/open-policy-agent/opa/releases/download/v${OPA_VERSION}/opa_linux_amd64 2>/dev/null;
# chmod +x /usr/bin/opa;
- name: Test
env:
TERM: xterm-256color
Expand All @@ -64,4 +64,5 @@ jobs:
tput sgr0;
opa eval -f pretty --data $pol -i ${pol%.rego}.input.json data.terraform.deny;
done;
done;
done;
uses: ./.github/actions/opa

0 comments on commit 474ca56

Please sign in to comment.