always allow workflows to mount /srv/example

because it is generally useful to store informations about how the
workflow ran
This commit is contained in:
Earl Warren 2024-01-05 18:11:19 +01:00
parent 11bf9b45c7
commit b63144cb0d
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
11 changed files with 30 additions and 50 deletions

View file

@ -10,7 +10,7 @@ jobs:
runs-on: docker
container:
image: code.forgejo.org/oci/node:20-bookworm
options: "--volume /srv/example-pull-request:/srv/example-pull-request"
options: "--volume /srv/example:/srv/example"
steps:
- name: setup
@ -115,7 +115,7 @@ jobs:
- name: save event
run: |
d=/srv/example-pull-request/${{ github.event.pull_request.head.repo.owner.username }}/$GITHUB_EVENT_NAME/${{ github.event.action }}
d=/srv/example/pull-request/${{ github.event.pull_request.head.repo.owner.username }}/$GITHUB_EVENT_NAME/${{ github.event.action }}
mkdir -p $d
cat > $d/event <<'EOF'
${{ toJSON(github.event) }}

View file

@ -1,9 +1,11 @@
api=$url/api/v1
export d=/srv/example-pull-request
export d=/srv/example/pull-request
PROOF='some proof'
function setup() {
mkdir -p $d
forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token
forgejo-curl.sh api_json --data-raw '{"username":"fork-org"}' $api/orgs

View file

@ -1,30 +0,0 @@
log:
level: info
runner:
file: .runner
capacity: 1
env_file: .env
timeout: 3h
insecure: false
fetch_timeout: 5s
fetch_interval: 2s
labels: ["docker:docker://code.forgejo.org/oci/node:20-bookworm"]
cache:
enabled: false
dir: ""
host: ""
port: 0
container:
network: "bridge"
privileged: false
options:
workdir_parent:
valid_volumes: ["/srv/example-pull-request"]
docker_host: ""
host:
workdir_parent:

View file

@ -1,8 +1,2 @@
if test $(id -u) != 0 ; then
SUDO=sudo
fi
mkdir -p /srv/example/pull-request
$SUDO rm -fr /srv/example-pull-request/{root,fork-org}
rm -fr /srv/example-pull-request
mkdir -p /srv/example-pull-request
FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload

View file

@ -1 +0,0 @@
forgejo-runner.sh reload