Update kaggle-dataset.yml #9
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
| name: Fetch and Push Kaggle Dataset | |
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: '0 0 * * 0' # Runs every Sunday at midnight UTC | |
| jobs: | |
| download-dataset: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| - name: Install Dependencies | |
| run: pip install kaggle | |
| - name: Set Up Kaggle API Credentials | |
| run: | | |
| mkdir -p ~/.kaggle | |
| echo "{\"username\": \"${{ secrets.KAGGLE_USERNAME }}\", \"key\": \"${{ secrets.KAGGLE_API_KEY }}\"}" > ~/.kaggle/kaggle.json | |
| chmod 600 ~/.kaggle/kaggle.json | |
| - name: Verify Kaggle Authentication | |
| run: kaggle datasets list # Should return dataset lists if authentication is successful | |
| - name: Create Dataset Directory | |
| run: mkdir -p dataset | |
| - name: Download Dataset from Kaggle Competition | |
| run: kaggle competitions download -c ieee-fraud-detection -p dataset/ | |
| # Skip extraction; CSV files will remain zipped | |
| - name: List Files in Dataset Directory | |
| run: ls -l dataset/ | |
| - name: Commit and Push Dataset to GitHub | |
| run: | | |
| git config --global user.name "krish17Nov" | |
| git config --global user.email "[email protected]" | |
| git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/krish17Nov/IEEE-CIS-Fraud-Detection.git | |
| git add . | |
| git commit -m "Auto-update IEEE-CIS Fraud Detection dataset" | |
| git push origin main |