Skip to content

prod_code testedls -lrt #198

prod_code testedls -lrt

prod_code testedls -lrt #198

name: Analyze Code Changes
on:
push:
branches:
- master # Change this to your default branch
- master_UAT # Change this to your default branch
jobs:
analyze-changes:
runs-on: ubuntu-latest
env:
NETWORKX_S3: "my-networkx-s3-bucket"
CODE_JS_PYTHON: "./code_db/js/"
CODE_JS_SCANNER: "./utils/js_ast_utils/js_ast_process.js"
AST_CONFIG: "./config/python/ast_config.json"
GRAPH_INPUT_FILE_NM_SUFFIX: "graph_entity_summary"
GRAPH_UTILS_FOLDER: "./utils/graph_utils/"
DAEMON_CONFIG: "./config/daemon_config.json"
IKG_HOME: "./"
CODE_DB_PYTHON: "./code_db/python/"
AST_UTILS_FOLDER: "./utils/ast_utils/"
LLM_CONFIG_PATH: "./utils/LLM_INTERFACE/llm_config.json"
VALID_FILE_EXTENSIONS: ".js,.py,.java"
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Print a message
run: echo "GitHub Actions is working!"
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8' # Specify the version of Python you need
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # Ensure you have a requirements.txt file if dependencies are needed
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Identify changed files
id: changes
run: |
git diff ${{ github.event.before }} ${{ github.sha }} > changed_files.txt
- name: Run analysis script
run: |
python trigger_dependency_analysis.py changed_files.txt
- name: Upload generated files
uses: actions/upload-artifact@v2
with:
name: generated-files
path: |
changes_for_further_analysis.json
# Add other files or directories you want to upload here
check_and_download:
runs-on: ubuntu-latest
needs: analyze-changes
steps:
- name: Install jq
run: sudo apt-get install -y jq
- name: Check if the analyze-changes job was successful
if: ${{ needs.analyze-changes.result == 'success' }}
run: |
# Get the current workflow run ID
RUN_ID=${{ github.run_id }}
REPO_OWNER="AmyGB-ai"
REPO_NAME="IKG"
ARTIFACT_NAME="generated-files"
GITHUB_TOKEN="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"
echo "LATEST RUN ID->$RUN_ID"
sleep 10
echo "curl -H Authorization: token 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 https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/actions/runs/$RUN_ID/artifacts"
_URL=$( curl -H "Authorization: token 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" \
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/actions/runs/$RUN_ID/artifacts" )
echo "LATEST URL-> $_URL"
#ARTIFACT_URL=$(curl -H "Authorization: token $GITHUB_TOKEN" \
# "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/actions/runs/$RUN_ID/artifacts" \
# | jq -r ".artifacts[] | select(.name==\"$ARTIFACT_NAME\") | .archive_download_url")
#curl -L -H "Authorization: token $GITHUB_TOKEN" -o $ARTIFACT_NAME.zip $ARTIFACT_URL
#echo "Artifact downloaded and extracted successfully."