test(discord): Add null-guard branch coverage for BotService constructor #594
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
| --- # PR: update pull request metadata | |
| # Maintain in repo: funfair-server-template | |
| name: "PR: Update" | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{github.workflow}}-${{github.ref}} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| env: | |
| HEAD_REF: ${{github.head_ref}} | |
| BASE_REF: ${{github.base_ref}} | |
| jobs: | |
| requirements: | |
| if: github.actor != 'dependabot[bot]' | |
| runs-on: [self-hosted, linux, build] | |
| steps: | |
| - name: "Check Required Secrets" | |
| shell: bash | |
| run: | | |
| if [ -z "${{secrets.SOURCE_PUSH_TOKEN}}" ]; then | |
| echo "::error::SOURCE_PUSH_TOKEN is required but not set" | |
| exit 1 | |
| fi | |
| info: | |
| if: endsWith(github.repository , '-template') | |
| runs-on: [self-hosted, linux, build] | |
| steps: | |
| - name: "Initialise Workspace" | |
| if: runner.environment == 'self-hosted' | |
| shell: bash | |
| run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE" | |
| - name: "Set Active Environment" | |
| shell: bash | |
| run: | | |
| { | |
| echo "ACTIVE_RUNNER_NAME=${{runner.name}}" | |
| echo "ACTIVE_HOSTNAME=$HOSTNAME" | |
| echo "ACTIVE_USER=$USER" | |
| } >> "$GITHUB_ENV" | |
| - name: "Info" | |
| uses: actions/github-script@v9.0.0 | |
| with: | |
| script: | | |
| core.info(`Branch: ${process.env.HEAD_REF}`); | |
| core.info(`Base Branch: ${process.env.BASE_REF}`); | |
| core.info(`Repo: ${context.repo.owner}/${context.repo.repo}`); | |
| core.info(`Owner: ${context.repo.owner}`); | |
| core.info(`Assigned: ${context.payload.pull_request?.assignee?.login}`); | |
| core.info(`Assigned: ${context.payload.pull_request?.assignees?.[0]?.login}`); | |
| core.info(`Last Modified By: ${context.payload.pull_request?.head?.user?.login}`); | |
| core.info(`PR Creator: ${context.payload.pull_request?.user?.login}`); | |
| core.info(`PR Owner: ${context.payload.pull_request?.user?.login}`); | |
| core.info(`Actor: ${context.actor}`); | |
| add-pr-label: | |
| needs: [requirements] | |
| if: ${{github.actor != 'dependabot[bot]'}} | |
| runs-on: [self-hosted, linux, build] | |
| steps: | |
| - name: "Initialise Workspace" | |
| if: runner.environment == 'self-hosted' | |
| shell: bash | |
| run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE" | |
| - name: "Set Active Environment" | |
| shell: bash | |
| run: | | |
| { | |
| echo "ACTIVE_RUNNER_NAME=${{runner.name}}" | |
| echo "ACTIVE_HOSTNAME=$HOSTNAME" | |
| echo "ACTIVE_USER=$USER" | |
| } >> "$GITHUB_ENV" | |
| - name: "Checkout Source" | |
| uses: actions/checkout@v7.0.0 | |
| with: | |
| clean: true | |
| fetch-depth: 1 | |
| - name: "Add Labels" | |
| uses: ./.github/actions/sync-labels | |
| with: | |
| github-token: ${{secrets.SOURCE_PUSH_TOKEN}} | |
| pr-number: ${{github.event.pull_request.number}} | |
| assign-to-creator: | |
| needs: [requirements] | |
| if: |- | |
| !github.event.pull_request.assignee.login | |
| && github.event_name == 'pull_request' | |
| && ( github.event.action == 'opened' || github.event.action == 'reopened') | |
| && github.actor != 'dependabot[bot]' | |
| runs-on: [self-hosted, linux, build] | |
| steps: | |
| - name: "Initialise Workspace" | |
| if: runner.environment == 'self-hosted' | |
| shell: bash | |
| run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE" | |
| - name: "Set Active Environment" | |
| shell: bash | |
| run: | | |
| { | |
| echo "ACTIVE_RUNNER_NAME=${{runner.name}}" | |
| echo "ACTIVE_HOSTNAME=$HOSTNAME" | |
| echo "ACTIVE_USER=$USER" | |
| } >> "$GITHUB_ENV" | |
| - name: "Checkout Source" | |
| uses: actions/checkout@v7.0.0 | |
| with: | |
| clean: true | |
| fetch-depth: 1 | |
| - name: "Assign PR to the creator" | |
| uses: ./.github/actions/assign-pr-to-creator | |
| with: | |
| github-token: ${{secrets.SOURCE_PUSH_TOKEN}} |