Skip to content

Commit

Permalink
updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AjitPadhi-Microsoft committed Dec 5, 2024
1 parent 055fa95 commit 9cab293
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
- reopened
- synchronize
merge_group:
workflow_dispatch:
workflow_dispatch: # Allow manual triggering
inputs:
branch_name:
description: 'Branch name'
Expand All @@ -35,9 +35,11 @@ jobs:
ref: ${{ github.event.inputs.branch_name }}
- run: git branch
- run: env
- name: Get branch ...
run: |
echo "Input branch ${{github.event.inputs.branch_name}}"
- name: Print Debug Info
run: |
echo "Event Name: ${{ github.event_name }}"
echo "Workflow Conclusion: ${{ github.event.workflow_run.conclusion }}"
echo "Branch Name: ${{ github.event.inputs.branch_name || env.BRANCH_NAME }}"
docker-build:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,11 @@ jobs:
run: make unittest-frontend
- name: Lint
run: make lint
- name: Install GitHub CLI
run: sudo apt-get install gh
- name: Set GH_TOKEN
run: echo "GH_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Trigger Build Docker Images Workflow
uses: actions/github-script@v7
with:
script: |
const branchName = process.env.GITHUB_REF.replace('refs/heads/', '');
const response = await github.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build-docker-images.yml',
ref: github.ref,
inputs: {
branch_name: branchName
}
});
console.log(response);
run: gh workflow run build-docker-images.yml --ref ${{ github.head_ref || github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 9cab293

Please sign in to comment.