Closed davidferlay closed 10 months ago
action.yaml:
action: title: Compare artifact description: Get expected artifact to compare current one and generate diff file arguments: - name: username title: Username description: The username to get comparison artifact with - name: password title: Username description: The password to get comparison artifact with options: - name: override title: Overriden comparison reference (branch or tag name) image: platform-actions-compare-artifact:latest build: context: ./ args: USER_ID: {{.current_uid }} GROUP_ID: {{.current_gid}} tags: - platform-actions-compare-artifact:latest - platform-actions-compare-artifact:1.0.0 command: - sh - /action/x.sh - "{{.username}}" - "{{.password}}" - "{{.override}}"
Dockerfile:
FROM alpine:3.18 WORKDIR /host ARG USER_ID ARG GROUP_ID RUN echo ${USER_ID} RUN echo ${GROUP_ID} RUN adduser -D -u $USER_ID -g $GROUP_ID plasma || true USER plasma
action: title: Compare artifact description: Get expected artifact to compare current one and generate diff file arguments: - name: username title: Username description: The username to get comparison artifact with - name: password title: Username description: The password to get comparison artifact with options: - name: override title: Overriden comparison reference (branch or tag name) image: platform-actions-compare-artifact:latest build: context: ./ env: USER_ID: {{.current_uid }} GROUP_ID: {{.current_gid}} tags: - platform-actions-compare-artifact:latest - platform-actions-compare-artifact:1.0.0 command: - sh - /action/x.sh - "{{.username}}" - "{{.password}}" - "{{.override}}"
FROM alpine:3.18 WORKDIR /host RUN echo ${USER_ID} RUN echo ${GROUP_ID} RUN adduser -D -u $USER_ID -g $GROUP_ID plasma || true USER plasma
{{.current_uid }}
{{.current_gid}}
Fixed by moving env: outside of build:
env:
build:
cf https://github.com/launchrctl/launchr/blob/main/example/envvars/action.yaml
Context
Observed
action.yaml:
Dockerfile:
action.yaml:
Dockerfile:
Expected
{{.current_uid }}
and{{.current_gid}}
defined in action.yaml should be able to be passed to Dockerfile