Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
KTools2202 authored Jun 29, 2024
1 parent e9ca01d commit 1800f3a
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,21 @@ jobs:
steps:
- name: Check Trigger Event
id: check_trigger_event
env:
TRIGGER_MESSAGE_FILE: $GITHUB_WORKSPACE/trigger_message.env
run: |
echo "GITHUB_WORKSPACE is $GITHUB_WORKSPACE" # Debugging: Print GITHUB_WORKSPACE
# Ensure directory exists and create file
# Ensure the GITHUB_WORKSPACE directory exists
mkdir -p $GITHUB_WORKSPACE
touch $TRIGGER_MESSAGE_FILE
echo "Creating trigger message file..."
# Write trigger message based on event type
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "TRIGGER_MESSAGE=\"This workflow was triggered manually by ${{ github.actor }}.\"" > $TRIGGER_MESSAGE_FILE
echo "TRIGGER_MESSAGE=\"This workflow was triggered manually by ${{ github.actor }}.\"" > $GITHUB_WORKSPACE/trigger_message.env
else
echo "TRIGGER_MESSAGE=\"This workflow was triggered by ${{ github.event_name }}.\"" > $TRIGGER_MESSAGE_FILE
echo "TRIGGER_MESSAGE=\"This workflow was triggered by ${{ github.event_name }}.\"" > $GITHUB_WORKSPACE/trigger_message.env
fi
echo "Contents of $TRIGGER_MESSAGE_FILE:"
cat $TRIGGER_MESSAGE_FILE # Debugging: Print contents of the created file
echo "Contents of $GITHUB_WORKSPACE/trigger_message.env:"
cat $GITHUB_WORKSPACE/trigger_message.env # Debugging: Print contents of the created file
print-trigger-message:
needs: [check-trigger]
Expand All @@ -70,8 +67,7 @@ jobs:
env:
TRIGGER_MESSAGE_FILE: $GITHUB_WORKSPACE/trigger_message.env
run: |
echo "Sourcing $TRIGGER_MESSAGE_FILE..."
source $TRIGGER_MESSAGE_FILE
source $TRIGGER_MESSAGE_FILE || true # Use '|| true' to suppress error if file not found
echo "$TRIGGER_MESSAGE"
deploy:
Expand Down

0 comments on commit 1800f3a

Please sign in to comment.