Skip to content

Commit

Permalink
Add Environment in Workflow
Browse files Browse the repository at this point in the history
Signed-off-by: UdBe <[email protected]>
  • Loading branch information
UdBe committed Oct 22, 2024
1 parent 2d86116 commit 481830d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/ib_pipelines_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: IB Pipelines Tracker

on:
schedule:
- cron: '0 */3 * * *'
- cron: '0 */3 * * *'

workflow_dispatch:

permissions: read-all
Expand All @@ -12,6 +12,7 @@ jobs:
pipeline_check:
name: Image Pipeline Check
runs-on: ubuntu-latest
environment: actions-cicd

steps:
- name: Checkout Repository
Expand All @@ -29,16 +30,16 @@ jobs:
run: |
# Extract the content starting from Summary of Pipelines
summary=$(sed -n '/Summary of Pipelines:/,$p' output.txt)
# If summary is empty, use entire output.txt
if [ -z "$summary" ]; then
echo "Warning: 'Summary of Pipelines:' not found. Using entire output.txt as summary."
summary=$(cat output.txt)
fi
# Remove unwanted lines
summary=$(echo "$summary" | grep -v "::set-output name=workflow-status::passed")
# Get the workflow conclusion
workflow_conclusion="${{ job.status }}"
# Determine emoji based on status
Expand All @@ -49,13 +50,13 @@ jobs:
else
status_emoji="⚠️"
fi
# Construct the pipeline run URL
pipeline_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# Format the summary as a code block
formatted_summary=$(printf '```\n%s\n```' "$summary")
# Create the Message
message=$(cat <<EOM
Pipeline run: [View Pipeline]($pipeline_url)
Expand All @@ -65,7 +66,7 @@ jobs:
$formatted_summary
EOM
)
# Save the message to summary.txt
echo "$message" > summary.txt
Expand Down Expand Up @@ -117,4 +118,4 @@ jobs:
echo "Chunk file $chunk_file does not exist."
exit 1
fi
done
done

0 comments on commit 481830d

Please sign in to comment.