ci: small improvements #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Labels | |
on: | |
pull_request: | |
jobs: | |
check-labels: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches | |
- name: Detect Changes | |
id: detect | |
run: | | |
git fetch origin main | |
CHANGED_FILES=$(git diff --name-only origin/main...HEAD) | |
echo "Changed files: $CHANGED_FILES" | |
if echo "$CHANGED_FILES" | grep -q '^packages/std/'; then | |
echo "std_changed=true" >> $GITHUB_ENV | |
else | |
echo "std_changed=false" >> $GITHUB_ENV | |
fi | |
- name: Add Std Label | |
if: env.std_changed == 'true' | |
uses: actions-ecosystem/action-add-labels@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
labels: packages/std |