Skip to content

Commit

Permalink
chore: add concurrency in autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Dec 11, 2024
1 parent 482a2f0 commit 6bde30f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:
- main
jobs:
lint:
name: Lint
name: Lint Fix
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -48,3 +48,6 @@ jobs:
- name: Cargo Clippy
run: cargo +nightly clippy --fix --allow-dirty --all-features --workspace -- -D warnings
- uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
concurrency:
group: autofix-${{github.ref}}
cancel-in-progress: false
12 changes: 10 additions & 2 deletions crates/gh-workflow-tailcall/src/workflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,16 @@ impl Workflow {
}

fn lint_job(&self, auto_fix: bool) -> Job {
Job::new("Lint")
.permissions(Permissions::default().contents(Level::Read))
let job = if auto_fix {
Job::new("Lint Fix").concurrency(
Concurrency::new(Expression::new("autofix-${{github.ref}}"))
.cancel_in_progress(false),
)
} else {
Job::new("Lint")
};

job.permissions(Permissions::default().contents(Level::Read))
.add_step(Step::checkout())
.add_step(Toolchain::default().add_nightly().add_clippy().add_fmt())
.add_step(
Expand Down

0 comments on commit 6bde30f

Please sign in to comment.