end-to-end/actions/example-context/action-for-context/action.yml
Earl Warren cd1a0f5076
chore: add assertions for the forge context and use it instead of github where relevant (#748)
Refs forgejo/act#37

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/748
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-06 12:15:38 +00:00

25 lines
879 B
YAML

inputs:
input-one:
default: 'one'
description: 'description one'
runs:
using: "composite"
steps:
- name: GITHUB_ACTION_REPOSITORY
run: |
set -x
test "$GITHUB_ACTION_REPOSITORY" = root/action-for-context
test "$GITHUB_ACTION_REPOSITORY" = "${{ env.GITHUB_ACTION_REPOSITORY }}"
test "$GITHUB_ACTION_REPOSITORY" = "${{ github.ACTION_REPOSITORY }}"
test "$GITHUB_ACTION_REPOSITORY" = "${{ forge.ACTION_REPOSITORY }}"
touch /srv/example/example-context/GITHUB_ACTION_REPOSITORY
- name: GITHUB_ACTION_PATH
shell: bash
run: |
set -x
[[ "$GITHUB_ACTION_PATH" =~ action-for-context@main$ ]]
test "$GITHUB_ACTION_PATH" = "${{ github.ACTION_PATH }}"
test "$GITHUB_ACTION_PATH" = "${{ forge.ACTION_PATH }}"
touch /srv/example/example-context/GITHUB_ACTION_PATH