Backend: Improved Enforced Config Values #9937
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
| # Execution context: base branch code (pull_request_target) | |
| name: Check PR Dependencies | |
| on: | |
| pull_request_target: | |
| types: [ opened, edited, closed, reopened, synchronize ] | |
| # Only one run per PR at a time, so an older run cannot publish a stale result after a newer one. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| statuses: write | |
| jobs: | |
| # Marks the required status as pending before the real check runs. Without this, the status of an | |
| # earlier run stays green on an unchanged head SHA while this run is still queued, which is exactly | |
| # what happens when a dependency is added to the body of an already open PR. | |
| set-pending: | |
| runs-on: ubuntu-latest | |
| # 511310721 is the Repository ID for SkyHanni | |
| # On "closed" the check evaluates other PRs, so a pending status on this PR would be wrong. | |
| if: ${{ github.repository_id == '511310721' && github.event.action != 'closed' }} | |
| # A failure here must never turn the workflow red, it only falls back to the previous behaviour. | |
| continue-on-error: true | |
| steps: | |
| - name: Mark dependency check as pending | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
| STATUS_CONTEXT: Check PR Dependencies | |
| run: | | |
| run_url="https://github.com/$GITHUB_REPOSITORY" | |
| run_url="$run_url/actions/runs/$GITHUB_RUN_ID" | |
| gh api "repos/$GITHUB_REPOSITORY/statuses/$HEAD_SHA" \ | |
| -f state=pending \ | |
| -f context="$STATUS_CONTEXT" \ | |
| -f description="Checking dependency PRs" \ | |
| -f target_url="$run_url" | |
| check-dependencies: | |
| runs-on: ubuntu-latest | |
| needs: set-pending | |
| # 511310721 is the Repository ID for SkyHanni | |
| # !cancelled() keeps this job running when set-pending was skipped on "closed". | |
| if: ${{ !cancelled() && github.repository_id == '511310721' }} | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v7 | |
| with: | |
| # Avoid treating the trusted merge commit as fork code on merged PRs. | |
| ref: ${{ github.event.pull_request.base.ref }} | |
| persist-credentials: false | |
| - name: Evaluate dependency PRs | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| MODE: dependencies | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| PR_STATE: ${{ github.event.pull_request.state }} | |
| PR_MERGED: ${{ github.event.pull_request.merged }} | |
| PR_ACTION: ${{ github.event.action }} | |
| run: kotlinc -script .github/scripts/pr_review.main.kts |