Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/sample-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
print_hello_world_job:
runs-on: ubuntu-latest
steps:
- name: Print Hello World Sep 1
- name: Print Hello World Step 1
run: echo "Hello world!"
- name: Print Hello World Sep 2
- name: Print Hello World Step 2
run: echo "Great Job!"
2 changes: 1 addition & 1 deletion .github/workflows/sample-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ jobs:
print_scheduled_message_job:
runs-on: ubuntu-latest
steps:
- name: Print Scheduled Message Sep 1
- name: Print Scheduled Message Step 1
run: echo "This message is printed every 5 minutes."
6 changes: 3 additions & 3 deletions .github/workflows/sample-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
steps:
- name: Using Checkout Repository
uses: actions/checkout@v4
- name: List Repository Sep 1
- name: List Repository Step 1
run: echo "Listing repository contents..."
- name: List Repository Sep 2
- name: List Repository Step 2
run: ls -la
- name: List Repository Sep 3
- name: List Repository Step 3
run: echo "Repository listing complete!"
36 changes: 23 additions & 13 deletions .github/workflows/sample-4.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
name: List_Variable_Flow
name: List_Variables_Flow
on:
workflow_dispatch:
workflow_dispatch:
env:
MY_GLOBAL_VARIABLE: "Any Global Value" # This variable is available to all jobs
jobs:
list_variable_job:
runs-on: ubuntu-latest
env:
MY_VARIABLE: "Hello, World!"
steps:
- name: Print Variable Sep 1
run: echo "The value of MY_VARIABLE is $MY_VARIABLE"
- name: Print Variable Sep 2
run: echo "The value of SECRET is ${{secrets.MY_TOKEN_SECRET}}"
- name: Print Variable Sep 3
run: echo "Variable printing complete!"
list_variable_job:
runs-on: ubuntu-latest
env:
MY_LOCAL_VARIABLE: "Hello, World!" # This variable is only available in this job
steps:
- name: Print Variables Step 1
run: |
echo "The value of MY_GLOBAL_VARIABLE is ${{env.MY_GLOBAL_VARIABLE}}"
echo "The value of MY_LOCAL_VARIABLE is ${{env.MY_LOCAL_VARIABLE}}"
echo "The value of MY_ENV_VARIABLE is ${{vars.MY_TOKEN_VARIABLE}}"
echo "The value of SECRET is ${{secrets.MY_TOKEN_SECRET}}"
list_dynamic_job:
runs-on: ubuntu-latest
steps:
- name: Set Dynamic Variable Step 1
run: echo "MY_DYNAMIC_VARIABLE=dynamic value" >> $GITHUB_ENV

- name: Print Dynamic Variable Step 2
run: echo $MY_DYNAMIC_VARIABLE
18 changes: 18 additions & 0 deletions .github/workflows/sample-4_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: List_Context_Variables_Flow
on:
workflow_dispatch:
jobs:
list_context_job:
runs-on: ubuntu-latest
steps:
- name: Print context Step 1
run: |
echo "The event that triggered this workflow is ${{ github.event_name }}."
echo "The repository name is ${{ github.repository }}."
echo "The actor who triggered this workflow is ${{ github.actor }}."
- name: Print context Step 2
run: |
echo "The workflow job name is ${{ job.name }}."
echo "The workflow job status is ${{ job.status }}."
echo "The workflow job steps are ${{ toJson(job.steps) }}."
echo "The workflow job strategy is ${{ toJson(job.strategy) }}."
7 changes: 7 additions & 0 deletions .github/workflows/sample-5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Call_Reusable_Action_Flow
on:
push:
branches: [develop]
jobs:
call_reusable_job:
uses: ./.github/workflows/sample-5_1.yaml
9 changes: 9 additions & 0 deletions .github/workflows/sample-5_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Create_Reusable_Action_Flow
on:
workflow_call:
jobs:
create_reusable_job:
runs-on: ubuntu-latest
steps:
- name: Create Reusable Step 1
run: echo "Called Reusable Workflow!"