Skip to content

Commit

Permalink
Update 00-Check_Coding_Convention.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Silabs-ThieuVu authored Oct 16, 2024
1 parent 20a1e73 commit 287f744
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/00-Check_Coding_Convention.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,22 @@ jobs:
steps:
- name: Trigger
run: echo "Triggered by ${{github.event_name}} event"

- name: Check Branch Input
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ -z "${{ github.event.inputs.branch }}" ]; then
echo "Branch input is required for manual trigger."
exit 1
else
echo "Checkout branch ${{ github.event.inputs.branch }}"
fi
else
# Extract branch name from github.ref
BRANCH_NAME="${{ github.ref }}"
BRANCH_NAME="${BRANCH_NAME##*/}" # This removes everything before the last '/'
echo "Checkout branch $BRANCH_NAME"
fi
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ -z "${{ github.event.inputs.branch }}" ]; then
echo "Branch input is required for manual trigger."
exit 1
fi
fi
- name: Checkout
uses: actions/[email protected]

uses: actions/[email protected]
with:
ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}"
- name: Log Current Branch and Commit
run: |
echo "Current branch: $(git rev-parse --abbrev-ref HEAD)"
echo "Current commit: $(git rev-parse HEAD)"
- name: Install python3.11
if: always()
run: |
Expand Down

0 comments on commit 287f744

Please sign in to comment.