feat: otter sdk training - how to use the otter sdk #8910
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: Pull Request Label | |
on: pull_request | |
permissions: | |
contents: read | |
jobs: | |
setup-label: | |
runs-on: ubuntu-latest | |
env: | |
SKIP_ON_LABELS: '["cascading"]' | |
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
permissions: | |
pull-requests: write | |
issues: write | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Setup | |
uses: ./tools/github-actions/setup | |
- name: Determine labels | |
run: | | |
LABELS="$(yarn pr-labels --target="${{ github.base_ref || github.ref_name }}")" | |
echo "LABELS=$LABELS" >> $GITHUB_ENV | |
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
if: env.LABELS != '[]' | |
continue-on-error: true | |
with: | |
script: | | |
const [owner, repo] = '${{ github.repository }}'.split('/'); | |
const pLabels = github.rest.issues.listLabelsOnIssue({ | |
owner, | |
repo, | |
issue_number: context.issue.number | |
}); | |
return pLabels.then((labels) => { | |
const skipLabelUpdate = labels.data.some(({ name }) => ${{ env.SKIP_ON_LABELS }}.includes(name)); | |
if (skipLabelUpdate) { | |
github.log.info('Skip label setting for this Pull Request.'); | |
return ; | |
} | |
return github.rest.issues.addLabels({ | |
owner, | |
repo, | |
issue_number: context.issue.number, | |
labels: ${{ env.LABELS }} | |
}); | |
}); |