Releases: bojieyang/indexnow-action
v2.0
What's Changed
- Upgrade nodes version to v20.
- Use native fetch api instead of cross-fetch.
- Fix issue #136 by @TheJiahao.
New Contributors
- @TheJiahao made their first contribution in #136.
v1.1.2
Upgrade fast-xml-parser to 4.2.5 to fix regex vulnerability security issue.
IndexNow Action
A GitHub Action that automatically submits URLs to participating search engines through the IndexNow protocol.
Usage
Prerequisites
The key file has been obtained from IndexNow and added to your website.
If you don't know how to get the key file, see IndexNow Document.
Basic
steps:
# v1 is the latest major version following the action-versioning guide.
- uses: bojieyang/indexnow-action@v1
with:
sitemap-location: "https://example.com/sitemap.xml" # your sitemap location, must start with http(s).
key: ${{ secrets.INDEXNOW_KEY }} # The key you get from IndexNow.
Examples
A complete example used in my blog shows below:
name: "IndexNow"
on:
schedule:
# Set the schedule time
- cron: "0 2 * * *"
jobs:
check-and-submit:
runs-on: ubuntu-latest
steps:
- name: indexnow-action
uses: bojieyang/indexnow-action@v1
with:
sitemap-location: "https://bojieyang.github.io/sitemap.xml"
key: ${{ secrets.INDEXNOW_KEY }}
View code from here.
Inputs
-
sitemap-location
required
.
The location of sitemap file in your website. Must start with https or http(e.g., https://example.com/sitemap.xml). -
key
required
.
The IndexNow key that you get from search engines.Note DO NOT stored as plaintext in the workflow file. Use GitHub Secrets instead.
More about GitHub Secrets, see Encrypted Secrets. -
key-location
optional
.
Location of the IndexNow key file that you customed.
If not set, it will assume that there is a file named{your-indexnow-key}.txt
in the root directory of the website(e.g., https://example.com/{your-indexnow-key}.txt).Note DO NOT stored as plaintext in the workflow file. Use GitHub Secrets instead.
More about GitHub Secrets, see Encrypted Secrets. -
since
optional
.
Thelastmod
field in the sitemap that for past {n} {since-unit} will be submit. The default value is 1. -
since-unit
optional
.
The unit of since. Available units areminute
,hour
,day
,week
,month
andyear
. The default value isday
. -
endpoint
optional
.The endpoint of a special search engine. Available units are
api.indexnow.org
,www.bing.com
,search.seznam.cz
andyandex.com
. For more details, see: IndexNow FAQ. The default value is www.bing.com. -
limit
optional
.
The upper limit for submitting URLs. The default value is 100. -
timeout
optional
.
The timeout both fetch sitemap and submit to the search engine in milliseconds. The default value is 10000 (10 seconds). -
failure-strategy
optional
Define the strategy when submit failed. Available strategy areignore
anderror
.
Forignore
, will outputting an notice only.
Forerror
, outputting an error message also sets the status of action to fail. The Default value isignore
.
Maintainers
Acknowledgements
Use @seantomburke/sitemapper to fetch and parse sitemap.
Contributing
Contributions are welcome! Please create an issue and if applicable, a design before proceeding with code.
License
The scripts and documentation in this project are released under the MIT License
v1.1.1
Security
- Upgrade fast-xml-parser to 4.2.4 to fix entity parsing issue.
v1.1.0
Added
- Support RSS 2.0 and Atom 1.0 format as sitemap.