Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asdas #215

Closed
wants to merge 5 commits into from
Closed

Asdas #215

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/hello.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run Hello World with Dynamic Name

on:
push:
branches:
- main
workflow_dispatch:
inputs:
personName:
description: 'Person Name'
required: true # Making it required to ensure a name is always provided
default: 'John'

jobs:
run-script:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Run Hello World script with dynamic name
env:
PERSON_NAME: ${{ github.event.inputs.personName }}
run: python hello.py
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ __pycache__/
*.so
*~
venv/

# due to using nox and pytest
.nox
.cache
8 changes: 8 additions & 0 deletions hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# hello_world.py
import os

# Get the name from the environment variable
name = os.getenv('PERSON_NAME', 'John') # Default name is 'John' if not provided

# Print the greeting message
print(f"Hello, World! {name}")