-
-
Notifications
You must be signed in to change notification settings - Fork 273
63 lines (55 loc) · 2.22 KB
/
irctc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: IRCTC Automation Booking
on:
push:
branches:
- 'main'
pull_request:
workflow_dispatch:
inputs:
USERNAME:
required: true
type: string
description: "Your IRCTC Username"
PASSWORD:
required: true
type: string
description: "Your IRCTC Password"
UPI_ID:
required: true
type: string
description: "Your UPI ID To Make Payment From"
jobs:
IRCTC-Booking:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip' # caching pip dependencies
- run: |
sudo timedatectl set-timezone Asia/Kolkata
pip install -r irctc-captcha-solver/requirements.txt
python3 irctc-captcha-solver/app.py "" # python3 irctc-captcha-solver/app.py "" is used for models to load before starting tatkal tickets
PASSWORD=$(jq -r '.inputs.PASSWORD' $GITHUB_EVENT_PATH)
USERNAME=$(jq -r '.inputs.USERNAME' $GITHUB_EVENT_PATH)
UPI_ID=$(jq -r '.inputs.UPI_ID' $GITHUB_EVENT_PATH)
echo ::add-mask::$PASSWORD
echo ::add-mask::$USERNAME
echo ::add-mask::$UPI_ID
echo PASSWORD=$PASSWORD >> $GITHUB_ENV
echo USERNAME=$USERNAME >> $GITHUB_ENV
echo UPI_ID=$UPI_ID >> $GITHUB_ENV
# python3 irctc-captcha-solver/app.py "" is used for models to load before starting tatkal tickets
- name: Install Node.js and npm
uses: actions/setup-node@v4
with:
node-version: '20.12.2'
- name: Installing Cypress & Running IRCTC Cypress Automation
run: |
npm install cypress
npx cypress run --browser chrome --headed --record --key a15b31a6-b9ee-4678-b9ac-f45a190851fe --env UPI_ID=${{ inputs.UPI_ID || '' }},USERNAME=${{ inputs.USERNAME || secrets.USERNAME }},PASSWORD=${{ inputs.PASSWORD || secrets.PASSWORD }}
# - name: Running IRCTC Cypress Script
# uses: cypress-io/github-action@v6
# with:
# command: npx cypress run --record --key a15b31a6-b9ee-4678-b9ac-f45a190851fe --env UPI_ID=${{ inputs.UPI_ID || '' }},USERNAME=${{ inputs.USERNAME || secrets.USERNAME }},PASSWORD=${{ inputs.PASSWORD || secrets.PASSWORD }}