Skip to content

chore(deps): update dependency @swc/core to v1.6.1 #3002

chore(deps): update dependency @swc/core to v1.6.1

chore(deps): update dependency @swc/core to v1.6.1 #3002

Workflow file for this run

name: Label a PR with its updated packages
on:
pull_request:
types: [opened, synchronize, ready_for_review]
jobs:
label-pr:
if: ${{ github.event.pull_request.draft == false && github.event.pull_request.user.login != 'triple-bot' && !contains(github.event.pull_request.labels.*.name, 'release') }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Get changed packages
run: |
RESPONSE=$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/compare/${{ github.event.pull_request.base.ref }}...${{ github.event.pull_request.head.ref }}")
if [[ $(echo "$RESPONSE" | jq '.total_commits') == null ]]; then
echo $RESPONSE | jq '.message'
exit 1
fi
CHANGED_PACKAGES=$(echo "$RESPONSE" | jq '[.files[].filename | capture("packages/(?<packageName>[^/]+)/") .packageName] | unique | tostring')
echo "CHANGED_PACKAGES=$CHANGED_PACKAGES" >> $GITHUB_ENV
- name: Label PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PACKAGE_LABELS=$(echo ${{ env.CHANGED_PACKAGES }} | jq .)
curl -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
-d "{\"labels\": $PACKAGE_LABELS }"