Skip to content

Commit

Permalink
Update router job to bring the ability to run main workflow outside P…
Browse files Browse the repository at this point in the history
…R back
  • Loading branch information
KonstantAnxiety committed Dec 27, 2023
1 parent 1c15edd commit 47c4cf5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,16 @@ jobs:
- run: git config --global --add safe.directory .
- run: git config --global --add safe.directory /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
- run: git fetch origin main
- name: Extract base commit
run: if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then result=$(git rev-parse origin/main); else result="${{ github.event.pull_request.base.sha }}"; fi && echo "result=$result" >> $GITHUB_OUTPUT
id: extract_base_commit
- name: Extract head commit
run: if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then result=$(git rev-parse HEAD); else result="${{ github.event.pull_request.head.sha }}"; fi && echo "result=$result" >> $GITHUB_OUTPUT
id: extract_head_commit
- name: Get packages affected by changes in the current commit
id: get_affected
run: |
TARGET_DATA=$(. /venv/bin/activate && dl-git range-diff-paths --only-added-commits --base ${{ github.event.pull_request.base.sha }} --head ${{ github.event.pull_request.head.sha }})
TARGET_DATA=$(. /venv/bin/activate && dl-git range-diff-paths --only-added-commits --base ${{ steps.extract_base_commit.outputs.result }} --head ${{ steps.extract_head_commit.outputs.result }})
echo "$TARGET_DATA" > /tmp/targets.json
cat /tmp/targets.json
. /venv/bin/activate && detect-affected-packages \
Expand Down

0 comments on commit 47c4cf5

Please sign in to comment.