Files
runner/e2e/testdata/workflows/payloads.yml
T
silverwindandbircni 6618e67645 fix: apply a job container without image to the runs-on image (#1252)
Fixes https://gitea.com/gitea/runner/issues/1251, a regression from https://gitea.com/gitea/runner/pulls/1233.

A job `container:` without an `image` key configures the runs-on image again, as in 3.x, so its `volumes`, `options`, `credentials` and `env` apply. An image that evaluates to empty still skips the container, as on GitHub.

---------

Co-authored-by: bircni <[email protected]>
Reviewed-on: https://gitea.com/gitea/runner/pulls/1252
Reviewed-by: Lunny Xiao <[email protected]>
Reviewed-by: bircni <[email protected]>
Co-authored-by: silverwind <[email protected]>
2026-09-28 09:43:48 +00:00

59 lines
1.8 KiB
YAML

name: payloads
on: push
jobs:
verify:
runs-on: ubuntu-latest
container:
env:
IMAGELESS_ENV: imageless-env-value
options: --hostname imageless-host
services:
web:
image: ${{ vars.E2E_SERVICE_IMAGE }}
steps:
- run: |
echo 'plain-100%-done;-[bracket]'
printf 'multiline-first\nmultiline-second\n'
echo '::notice::notice-payload-here'
echo '::warning::warning-payload-here'
echo '::error::error-payload-here'
echo '::group::group-payload-here'
echo 'inside-the-group'
echo '::endgroup::'
echo '::notice::encoded-first%0Aencoded-second'
echo "the variable is ${{ vars.GREETING }}"
echo "the secret is ${{ secrets.FOO }}"
echo "imageless env=$IMAGELESS_ENV host=$(hostname)"
curl --connect-timeout 1 --max-time 2 --retry 30 --retry-delay 1 --retry-max-time 30 --retry-all-errors -fsS -o /dev/null http://web/
produce:
runs-on: ubuntu-latest
outputs:
token: ${{ steps.emit.outputs.token }}
steps:
- id: emit
run: echo "token=produced-value-42" >> "$GITHUB_OUTPUT"
- run: echo "artifact content" > payload.txt
- uses: actions/upload-artifact@v4
with:
name: payload
path: payload.txt
consume:
needs: produce
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: payload
- run: grep -q 'artifact content' payload.txt
- run: |
echo "received=${{ needs.produce.outputs.token }}"
test "${{ needs.produce.outputs.token }}" = "produced-value-42"
cell:
runs-on: ubuntu-latest
strategy:
matrix:
letter: [a, b]
number: [1, 2]
steps:
- run: echo "cell-${{ matrix.letter }}-${{ matrix.number }}"