add action
This commit is contained in:
parent
3a63594f0c
commit
8514b25c2c
2 changed files with 46 additions and 0 deletions
22
.forgejo/workflows/test-my-custom-action.yml
Normal file
22
.forgejo/workflows/test-my-custom-action.yml
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
name: Test My Custom Self-Hosted Action
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # Erlaubt manuelles Starten
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run_my_action:
|
||||||
|
name: Run My Simple Log Action
|
||||||
|
runs-on: docker # Dein funktionierendes Runner-Label
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Optional: Code des aktuellen Repos auschecken, falls die Action ihn braucht
|
||||||
|
# Fr diese reine Log-Action ist es nicht ntig, aber oft will man ja mit dem Code arbeiten.
|
||||||
|
# - name: Checkout calling repository's code
|
||||||
|
# uses: badmomber/action-checkout@v4 # Annahme: action-checkout ist auch schon gespiegelt und funktioniert
|
||||||
|
|
||||||
|
- name: Execute my simple self-hosted log action
|
||||||
|
# Forgejo sollte dies zu https://git.kriegbaum.io/badmomber/simple-log-action@v1.0.0 auflsen
|
||||||
|
uses: badmomber/simple-log-action@v1.0.0 # Oder @main, wenn du keinen Tag erstellt hast
|
||||||
|
|
||||||
|
- name: Workflow finished
|
||||||
|
run: echo "Test workflow using custom action completed."
|
||||||
24
action.yml
Normal file
24
action.yml
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
name: 'Simple Log Action'
|
||||||
|
description: 'Logs a success message and some environment info to the console.'
|
||||||
|
author: 'badmomber' # Dein Name/Organisation
|
||||||
|
|
||||||
|
# Definiert, wie die Action ausgefhrt wird.
|
||||||
|
# 'composite' bedeutet, sie besteht aus einer oder mehreren Shell-Schritten.
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: Log Success Message
|
||||||
|
shell: bash # Explizit Bash verwenden
|
||||||
|
run: | # Mehrzeiliges Skript
|
||||||
|
echo "================================================================"
|
||||||
|
echo " Simple Log Action wurde erfolgreich aufgerufen und ausgefhrt! "
|
||||||
|
echo "Hallo von deiner selbst gehosteten Forgejo Action!"
|
||||||
|
echo "Repository: ${{ forgejo.repository }}"
|
||||||
|
echo "Ausgelstes Event: ${{ forgejo.event_name }}"
|
||||||
|
echo "Commit SHA: ${{ forgejo.sha }}"
|
||||||
|
echo "Aktuelles Datum und Uhrzeit: $(date)"
|
||||||
|
echo "Aktueller Benutzer: $(whoami)"
|
||||||
|
echo "Arbeitsverzeichnis: $(pwd)"
|
||||||
|
echo "Inhalt des Arbeitsverzeichnisses:"
|
||||||
|
ls -la
|
||||||
|
echo "================================================================"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue