In this tutorial, I will explain how we can push Postman Collection scripts in GitHub.
Table of Contents
Create an empty GitHub Repository
Step 1 – Login to GitHub using your username and password.
![](https://qaautomation.expert/wp-content/uploads/2023/01/image-81.png?w=1200)
Step 2 – In the upper-right corner of any page, use the drop-down menu, and select “New repository” or left side of the page, there is a green button “New“.
![](https://qaautomation.expert/wp-content/uploads/2023/01/image-82.png?w=1200)
Step 3 – Type a name for your repository, and an optional description. Here, I have provided below-mentioned information:
- Owner – vibssingh
- Repository name – Postman_GitHub_Integration
- Description – This repository contains the Postman Collection file (optional)
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-38.png?w=1001)
Step 4 – Choose repository visibility
I’m selecting the “Public” option as it is a free account. You can select the Private option for a paid account (mostly organizations). For more information, see “About repositories.”
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-39.png?w=950)
Step 5 – You can create a “README“, which is a document describing your project. For more information, see “About READMEs.”
- You can create a .gitignore file, which is a set of ignore rules. For more information, see “Ignoring files.“
- You can choose to add a software license for your project. For more information, see “Licensing a repository.”
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-40.png?w=1200)
Click the “Create repository” button.
Below is the screenshot of the new repository in GitHub.
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-41.png?w=1200)
Push Postman Collections to GitHub
Step 1 – From the Home page, select Integrations.
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-42.png?w=354)
Step 2 – Click on the “Browse All Integrations” button.
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-43.png?w=669)
Search and select GitHub.
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-44.png?w=821)
Step 3 – Next to “Backup a collection“, select “Add Integration“.
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-45.png?w=1200)
Step 4 – Enter your GitHub “Personal Access Token“ select “Authenticate and Proceed“.
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-46.png?w=584)
Step 5 – After Postman verifies the token, you can configure the integration:
- Give the integration a nickname – Postman_GitHub_Integration
- Select the workspace with the collection you want to back up – API_Testing (name of my workspace in Postman)
- Select a collection to back up –
- Select the GitHub repository where you want to back up the collection – vibssingh/Postman_GitHub_Integration (Repo created above)
- Enter the directory where you want to push the collection. If the directory doesn’t exist, Postman will create it for you. If you don’t specify a directory, Postman will create a Postman Collections directory – No directory is created in the GitHub Repository.
- Enter the file name of the collection in the repository – API_Newman_PassedTests.json
- Select the branch where you want to push the collection. The branch must already exist in your repository. If you don’t specify a branch, Postman will push the collection to the default branch of the repository – main
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-48.png?w=430)
Step 6 – To finish setting up the integration, select Add Integration.
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-49.png?w=1200)
Every change saved to your Postman collection automatically commits changes to your GitHub repository in JSON format. Go to your GitHub repository to view your collections.
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-50.png?w=1200)
![](https://qaautomation.expert/wp-content/uploads/2023/09/image-51.png?w=1200)
Congratulations!!. We have just pushed Postman collection script in GitHub. Now you can clone this project and start working on it.