Add a list of your latest Instagram pictures to your README page with automated content refresh!
Check it on the Readme Profile!
- Go to your repository
- Add the following section to your README.md file, you can give whatever title you want. Just make sure that you use
<!-- INSTAGRAM-FEED:START --><!-- INSTAGRAM-FEED:END -->
in your readme. The workflow will replace this comment with the actual blog post list:
# Instagram feed
<!-- INSTAGRAM-FEED:START -->
<!-- INSTAGRAM-FEED:END -->
- Create a folder named
.github
and create aworkflows
folder inside it if it doesn't exist. - Create a new file named
instagram-feed-workflow.yml
with the following contents inside the workflows folder:
name: Latest instagram feed workflow
on:
schedule: # Run workflow automatically
- cron: '0 * * * *' # Runs every hour, on the hour
workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly
jobs:
update-readme-with-instagram:
name: Update this repo's README with latest instagram feed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: alqueraf/instagram-feed-action@master
with:
account: "alqueraf"
- Replace the above instagram account with your own account.
- Commit and wait for it to run automatically or you can also trigger it manually from the Actions tab to see the result instantly.
This workflow has additional options that you can use to customize it for your use case. The following are the list of options available:
Option | Default Value | Description | Required |
---|---|---|---|
account |
"" |
The name of the instagram account to use, eg: alqueraf |
Yes |
max_post_count |
6 |
Maximum number of posts you want to show on your readme | No |
image_size |
250 |
Image dimension in pixels for each post | No |
image_margin |
10 |
Margin between post images | No |
images_directory |
./images/instagram |
Directory where images are stored | No |
readme_path |
./README.md |
Path of the readme file you want to update | No |
gh_token |
Your GitHub token with repo scope | Use this to configure the token of the user that commits the workflow result to GitHub | No |
commit_message |
Updated with the latest instagram posts |
Allows you to customize the commit message | No |
committer_username |
instagram-feed-bot |
Allows you to customize the committer username | No |
committer_email |
[email protected] |
Allows you to customize the committer email | No |
If you are experiencing any bugs, don’t forget to open a new issue.
Hope you liked this project, don't forget to give it a star ⭐
- Node.js
v16.20.0
. - Ncc @vercel
v0.36.1
.
- To test the puppeteer service, uncomment the line
puppeteerService.getLatestInstagramPostsFromAccount
inside the PuppeteerService file and set your instagram account. (Optional) Uncomment the linesheadless: false
orpage.screenshot
to view the browser results. - Use
node services/puppeteer.service.js
to run the script.
- Before commiting your changes run
ncc build instagram-feed-action.js --license licenses.txt
to compile your changes. - Use
NODE_OPTIONS=--openssl-legacy-provider ncc build instagram-feed-action.js --license licenses.txt
if you get aERR_OSSL_EVP_UNSUPPORTED
error.