Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/assistant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [opened, synchronize, reopened]

jobs:
insights:
fibbot:
runs-on: ubuntu-latest
permissions:
issues: write
Expand All @@ -18,5 +18,9 @@ jobs:

- name: Run Rust Action
uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
pr_number: ${{ github.event.pull_request.number }}
enable_fib: true
max_threshhold: 105
pr_number: ${{ github.event.pull_request.number }}
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ COPY . .
RUN cargo build --release

# Stage 2: Create the runtime image
FROM debian:buster-slim

WORKDIR /app
FROM gcr.io/distroless/cc AS runtime

COPY --from=builder /ticket-assistant/target/release/ticket-assistant /ticket-assistant

Expand Down
16 changes: 7 additions & 9 deletions src/action.yml → action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ inputs:
max_threshhold:
description: "The maximum number action should compute"
required: true
# repo:
# description: "The repository in the format owner/repo."
# required: true
# github_token:
# description: "GitHub token for API access."
# required: true
pr_number:
description: "The pull request number."
required: true

runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.pr_number }}
# - ${{ inputs.repo }}
# - ${{ inputs.github_token }}
- ${{ inputs.enable_fib }}
- ${{ inputs.max_threshhold }}
- ${{ inputs.pr_number }}
11 changes: 5 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@ use utils::{extract_numbers_from_text, parse_bool};
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let args = env::args().collect::<Vec<String>>();

if args.len() != 3 {
panic!("Missmatch required params, exactly two params are required: enable_fib, max_threshhold")
}

println!("Agrs: {:?}", args);

if args.len() != 4 {
panic!("Missmatch required params, exactly two params are required: enable_fib, max_threshhold and pr_number")
}

let gh_token = env::var("GITHUB_TOKEN").expect("Could not read GITHUB_TOKEN from env.");
let gh_repo =
env::var("GITHUB_REPOSITORY").expect("Could not read GITHUB_REPOSITORY form env.");
let pr_number = env::var("PR_NUMBER").expect("Could not read PR_NUMBER from variable.");

let gh_api = GhAPIClient::new(&gh_token, &gh_repo);

let [_, enable_fib, max_threshhold] = args.as_slice() else {
let [_, enable_fib, max_threshhold, pr_number] = args.as_slice() else {
panic!("Failed to read args");
};

Expand Down