Skip to content
Open
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
7 changes: 6 additions & 1 deletion .github/workflows/03-core-features--02-step-types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ jobs:
runs-on: ubuntu-24.04
steps:
- run: echo "Hello from an inline bash script in a GitHub Action Workflow!"
- run: echo $SHELL

say-hello-inline-python:
runs-on: ubuntu-24.04
steps:
- run: print("Hello from an inline python script in a GitHub Action Workflow!")
- run: |
import sys
print("Hello from Python")
print("Running with:", sys.executable)
print("Hello from an inline python script in a GitHub Action Workflow!")
shell: python

say-hello-action:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/03-core-features--06-passing-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ jobs:

# 1) Step output (for job output)
echo "foo=${foo}" >> "$GITHUB_OUTPUT"
echo "foo1=${foo1}"

# 2) Job-scoped environment variable
echo "FOO=${foo}" >> "$GITHUB_ENV"
echo "foo1=${foo}" >> "$GITHUB_ENV"

- name: Inspect values inside producer
run: |
echo "FOO (set via GITHUB_ENV): $FOO"
echo "foo1 (set via GITHUB_ENV): $foo1"
echo "foo (step output): ${{ steps.generate-foo.outputs.foo }}"

consumer:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/04-advanced-features--03-caching.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

# Populate directory only on miss
- name: Populate cache directory
if: steps.demo-cache.outputs.cache-hit != 'true'
# if: steps.demo-cache.outputs.cache-hit != 'true'
run: |
echo "Cache miss – generating contents"
mkdir -p demo-cache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,22 @@ on:
jobs:
read-only-pr:
runs-on: ubuntu-24.04
permissions:
pull-requests: read # Can read PR data only
continue-on-error: true # Avoids failing entire workflow
steps:
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0

- name: List the first 5 open PRs (allowed)
run: gh pr list --limit 5
run: |
gh pr list --limit 5
echo "done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Attempt to add a label (expected to fail)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "abc: ${{ secrets.GITHUB_TOKEN }}"
gh pr edit 1 --add-label "documentation"

- name: Confirm the failure
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_store
.DS_store
.idea/
1 change: 1 addition & 0 deletions 03-core-features/filters/excluded-file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
1 change: 1 addition & 0 deletions 03-core-features/filters/included-file-test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
1 change: 1 addition & 0 deletions 03-core-features/filters/included-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test 123 123 123
23 changes: 23 additions & 0 deletions scripts/git-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Exit if any command fails
set -e

# Check if commit message is provided
if [ -z "$1" ]; then
echo "Usage: $0 \"your commit message\""
exit 1
fi

COMMIT_MSG="$1"

# Add all changes
git add .

# Commit
git commit -m "$COMMIT_MSG"

# Push (default branch)
git push

echo "✅ Changes committed and pushed with message: $COMMIT_MSG"