Skip to content

Publish Check

Publish Check #21

Workflow file for this run

name: Publish Check
on:
workflow_run:
workflows:
- Build and Test
types:
- completed
jobs:
check_changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check for changes
id: check_changes
run: |
if git diff --name-only HEAD^ HEAD | grep -q "^sdk-node/"; then
echo "SDK_NODE_CHANGED=true" >> $GITHUB_OUTPUT
fi
if git diff --name-only HEAD^ HEAD | grep -q "^sdk-dotnet/"; then
echo "SDK_DOTNET_CHANGED=true" >> $GITHUB_OUTPUT
fi
if git diff --name-only HEAD^ HEAD | grep -q "^sdk-go/"; then
echo "SDK_GO_CHANGED=true" >> $GITHUB_OUTPUT
fi
- name: Print changed directories
run: |
echo "Changed directories:"
if [[ "${{ steps.check_changes.outputs.SDK_NODE_CHANGED }}" == "true" ]]; then
echo "- sdk-node"
fi
if [[ "${{ steps.check_changes.outputs.SDK_DOTNET_CHANGED }}" == "true" ]]; then
echo "- sdk-dotnet"
fi
if [[ "${{ steps.check_changes.outputs.SDK_GO_CHANGED }}" == "true" ]]; then
echo "- sdk-go"
fi