Bump 20241129-1 #1450
Workflow file for this run
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: Organize pull requests | |
on: | |
pull_request_target: | |
types: [opened, synchronize] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
jobs: | |
lint: | |
# Never ever ever run this on self-hosted runners | |
runs-on: ubuntu-latest # Did you read the disclaimer? | |
outputs: | |
fmt: ${{ steps.linter.outcome }} | |
steps: | |
- name: Install Nix | |
uses: cachix/install-nix-action@v30 | |
with: | |
extra_nix_config: | | |
accept-flake-config = true | |
system-features = big-parallel gccarch-x86-64-v3 | |
nix_path: "nixpkgs=channel:nixpkgs-unstable" | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Run linter | |
run: nix develop ./maintenance#linter -c 'chaotic-nyx-lint' | |
id: linter | |
working-directory: ${{ github.workspace }} | |
organize: | |
# Never ever ever run this on self-hosted runners | |
runs-on: ubuntu-latest # Did you read the disclaimer? | |
permissions: | |
pull-requests: write | |
needs: lint | |
if: (!cancelled() && (contains(github.event.pull_request.labels.*.name, 'cached') || (needs.lint.outputs.fmt == 'failure' && github.event.action == 'opened'))) | |
steps: | |
- name: Add comment | |
if: needs.lint.outputs.fmt == 'failure' && github.event.action == 'opened' | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: "Thank you for contributing to nyx! Please run `nix fmt` on your code before submitting a pull request. Afterwards, please force push your changes." | |
}) | |
- name: Remove cached label | |
if: contains(github.event.pull_request.labels.*.name, 'cached') | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.issues.removeLabel({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
name: "cached" | |
}) |