add example file illustrating local-action

This commit is contained in:
Loïc Dachary 2023-07-05 21:48:51 +02:00
parent 23e4bdbd6a
commit 16cd6fdca8
No known key found for this signature in database
GPG key ID: 992D23B392F9E4F2
3 changed files with 28 additions and 1 deletions

View file

@ -10,7 +10,7 @@ jobs:
./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo 1.19 ./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo 1.19
./forgejo-runner.sh setup ./forgejo-runner.sh setup
export FORGEJO_RUNNER_LOGS=forgejo-runner.log export FORGEJO_RUNNER_LOGS=forgejo-runner.log
for example in echo container expression ; do for example in echo container expression local-action ; do
echo "============================ example-$example ===================" echo "============================ example-$example ==================="
./forgejo-test-helper.sh run_workflow testdata/example-$example http://root:admin1234@$(cat forgejo-ip):3000 root example-$example setup-forgejo $(cat forgejo-token) ./forgejo-test-helper.sh run_workflow testdata/example-$example http://root:admin1234@$(cat forgejo-ip):3000 root example-$example setup-forgejo $(cat forgejo-token)
done done

View file

@ -0,0 +1,16 @@
inputs:
input-one:
default: 'one'
description: 'description one'
input-two-required:
description: 'description two'
required: true
outputs:
key:
description: 'output value'
value: "${{ steps.one.outputs.key }}"
runs:
using: "composite"
steps:
- run: echo key=${{ inputs.input-two-required }} >> $GITHUB_OUTPUT

View file

@ -0,0 +1,11 @@
on: [push]
jobs:
ls:
runs-on: docker
steps:
- uses: actions/checkout@v3
- id: local-action
uses: ./.forgejo/local-action
with:
input-two-required: "two"
- run: test "${{ steps.local-action.outputs.key }}" = "two"