diff --git a/.github/workflows/irctc.yml b/.github/workflows/irctc.yml index 5435b0d..50da860 100644 --- a/.github/workflows/irctc.yml +++ b/.github/workflows/irctc.yml @@ -1,9 +1,6 @@ name: IRCTC Automation Booking on: - # schedule: - # # “At minute 0 and 30 past every hour from 12 through 21.” - # - cron: '0,30 12-21 * * *' push: branches: - 'main' @@ -20,7 +17,6 @@ on: jobs: IRCTC-Booking: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 @@ -30,7 +26,21 @@ jobs: cache: 'pip' # caching pip dependencies - run: | pip install -r irctc-captcha-solver/requirements.txt - python3 irctc-captcha-solver/app.py "" + if [ -z "${{ env.USERNAME }}" ]; then + USERNAME="${{ secrets.USERNAME }}" + else + USERNAME="${{ env.USERNAME }}" + fi + if [ -z "${{ env.PASSWORD }}" ]; then + PASSWORD="${{ secrets.PASSWORD }}" + else + PASSWORD="${{ env.PASSWORD }}" + fi + echo ::add-mask::$PASSWORD + echo ::add-mask::$USERNAME + echo PASSWORD=$PASSWORD >> $GITHUB_ENV + echo USERNAME=$USERNAME >> $GITHUB_ENV + # python3 irctc-captcha-solver/app.py "" is used for models to load before starting tatkal tickets - name: Install Node.js and npm @@ -40,7 +50,6 @@ jobs: - name: Running IRCTC Cypress Script uses: cypress-io/github-action@v6 - # continue-on-error: true with: browser: chrome - command: npx cypress run --record --key a15b31a6-b9ee-4678-b9ac-f45a190851fe --browser chrome --env USERNAME=${{inputs.USERNAME}},PASSWORD=${{inputs.PASSWORD}} + command: npx cypress run --record --key a15b31a6-b9ee-4678-b9ac-f45a190851fe --browser chrome --env USERNAME=${{ env.USERNAME }},PASSWORD=${{ env.PASSWORD }}