Review/remove and prevent unintentional use of expect/assert*/panic/unwrap in hyperlight_host and hyperlght_common
#1281
Workflow file for this run
This file contains hidden or 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: Label Checker | |
| on: | |
| pull_request: | |
| branches: main | |
| types: [opened, labeled, unlabeled, synchronize, reopened] | |
| permissions: | |
| pull-requests: read | |
| contents: read | |
| jobs: | |
| check-labels: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check for specific labels | |
| run: | | |
| # ignore dependabot PRs | |
| if [[ ${{ github.actor }} == "dependabot[bot]" ]]; then | |
| echo "Ignoring dependabot PRs." | |
| exit 0 | |
| fi | |
| # Fetch repository labels from the GitHub API | |
| REPO_LABELS=$(gh api repos/${{ github.repository }}/labels --jq '.[].name') | |
| # Fetch labels applied to the current PR | |
| PR_NUMBER=${{ github.event.pull_request.number }} | |
| PR_LABELS=$(gh pr view $PR_NUMBER --json labels -q '.labels.[] | .name') | |
| # Check if any PR label matches a repository label | |
| for PR_LABEL in $PR_LABELS; do | |
| if echo "$REPO_LABELS" | grep -qw "$PR_LABEL"; then | |
| echo "Label '$PR_LABEL' matches a repository label." | |
| exit 0 | |
| fi | |
| done | |
| echo "None of the PR labels match repository labels." | |
| exit 1 | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |