fix: step container workdir and mounts (#93)

* fix: step container workdir and mounts
* avoid perm issues and do not mount tool_cache
This commit is contained in:
ChristopherHX
2025-04-26 14:14:52 +02:00
committed by GitHub
parent eddc77f3e0
commit a3c8116dee
8 changed files with 77 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
FROM debian:bullseye-slim
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
&& apt-get clean
# Copy the entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Set the entrypoint
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,12 @@
name: "Hello World Docker Action"
description: "A simple Docker action that prints Hello, World! and environment variables."
inputs:
who-to-greet:
description: "Who to greet"
required: false
default: "World"
runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.who-to-greet }}

View File

@@ -0,0 +1,18 @@
#!/bin/bash
set -e
# Print a greeting
echo "Hello, $1!"
# Print all environment variables
echo "Environment Variables:"
env
ls -la "$PWD"
ls -la "$PWD/docker-action-host-env"
if [ -f "$PWD/docker-action-host-env/Dockerfile" ]; then
echo "Dockerfile exists in workspace."
else
echo "Dockerfile does not exist in workspace."
fi

View File

@@ -0,0 +1,15 @@
name: Hello World Docker Action Workflow
on: [push]
jobs:
hello_world_job:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Hello World Docker Action
uses: ./docker-action-host-env/action
with:
who-to-greet: "GitHub"

View File

@@ -1,4 +1,4 @@
name: uses-docker-url
name: uses-nested-composite
on: push
jobs: