This commit is contained in:
parent
1b6adc3777
commit
2b45f5dbed
25
.gitea/workflows/lib/shared-action.yml
Normal file
25
.gitea/workflows/lib/shared-action.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Composite action shared between several jobs
|
||||||
|
name: 'Shared action'
|
||||||
|
description: 'Action shared between several jobs'
|
||||||
|
inputs:
|
||||||
|
param1:
|
||||||
|
description: 'The first parameter'
|
||||||
|
required: true
|
||||||
|
outputs:
|
||||||
|
output-one:
|
||||||
|
description: 'The output'
|
||||||
|
value: ${{ steps.second-step.outputs.output-one }}
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: 'First step'
|
||||||
|
run: |
|
||||||
|
echo "First step here. Param 1 is - ${{ inputs.param1 }}"
|
||||||
|
run: echo "output-one=this is my output" >> $GITHUB_OUTPUT
|
||||||
|
shell: bash
|
||||||
|
- name: 'Second step'
|
||||||
|
id: 'second-step'
|
||||||
|
run: |
|
||||||
|
echo "Second step here"
|
||||||
|
echo "env var 1 is - ${{ env.ENV_VAR_1 }}"
|
||||||
|
shell: bash
|
0
.gitea/workflows/second-job.yml
Normal file
0
.gitea/workflows/second-job.yml
Normal file
20
.gitea/workflows/test-job.yml
Normal file
20
.gitea/workflows/test-job.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
name: Composite Actions Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
env:
|
||||||
|
ENV_VAR_1: 'set in top level'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: "Test job"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: "Clone project repository"
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: "Call composite action"
|
||||||
|
uses: ./gitea/workflows/lib/shared-action.yml
|
||||||
|
|
Loading…
Reference in New Issue
Block a user