The first link gives a redirection to the second one:

curl --head https://github.com/vbajpai/nfql/archive/v0.7.tar.gz
HTTP/1.1 302 Found
Location: https://codeload.github.com/vbajpai/nfql/tar.gz/v0.7
...

How is the filename altered by the browsers when I directly click the source code link?

The filename is defined via a custom Content-Disposition HTTP header:

curl --head https://codeload.github.com/vbajpai/nfql/tar.gz/v0.7
HTTP/1.1 200 OK
Content-Disposition: attachment; filename=nfql-0.7.tar.gz
...

So you can use curl's -O, --remote-name, -L, --location and -J, --remote-header-name to (resp.) write output to a file named as the remote file, follow redirects and use the header-provided filename:

curl -LOJ https://github.com/vbajpai/nfql/archive/v0.7.tar.gz
Answer from deltheil on Stack Overflow
🌐
GitHub
docs.github.com › en › repositories › releasing-projects-on-github › managing-releases-in-a-repository
Managing releases in a repository - GitHub Docs
You can create new releases with release notes, @mentions of contributors, and links to binary files, as well as edit or delete existing releases. You can also create, modify, and delete releases by using the Releases API.
🌐
Stack Overflow
stackoverflow.com › questions › 68727457 › how-to-download-the-archived-github-release-source-code-using-github-actions
how to download the archived GitHub Release Source code using GitHub Actions - Stack Overflow
You can use the github action to fetch release data https://github.com/marketplace/actions/github-release-data, it also outputs the tarball and zipball output url of the release.
🌐
GitHub
docs.github.com › en › repositories › releasing-projects-on-github › about-releases
About releases - GitHub Docs
Releases are deployable software iterations you can package and make available for a wider audience to download and use.
🌐
GitHub
docs.github.com › en › repositories › working-with-files › using-files › downloading-source-code-archives
Downloading source code archives - GitHub Docs
On GitHub, navigate to the main page of the repository. To the right of the list of files, click Releases. At the top of the Releases page, click Tags. To download the source code, click zip or tar.gz.
🌐
Gharchive
gharchive.org
GH Archive
GH Archive is a project to record the public GitHub timeline, archive it, and make it easily accessible for further analysis.
🌐
GitHub
github.com › git › git › releases
Releases · git/git
Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (https://gitgitgadget.github.io/). Please follow Documentation/SubmittingPatches procedure for any of your improvements. - Releases · git/git
Author   git
Find elsewhere
🌐
GitHub
docs.github.com › en › repositories › archiving-a-github-repository › archiving-repositories
Archiving repositories - GitHub Docs
You can archive a repository to make it read-only for all users and indicate that it's no longer actively maintained. You can also unarchive repositories that have been archived.
🌐
Git
git-scm.com › docs › git-archive
Git - git-archive Documentation
git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip >git-1.4.0.tar.gz · Create a compressed tarball for v1.4.0 release.
🌐
GitHub
docs.github.com › en › repositories › releasing-projects-on-github
Releasing projects on GitHub - GitHub Docs
You can create a release to package software, release notes, and binary files for other people to download.
🌐
GitHub
cli.github.com › manual › gh_release_download
GitHub CLI | Take GitHub to the command line
# Download all assets from a specific release $ gh release download v1.2.3 # Download only Debian packages for the latest release $ gh release download --pattern '*.deb' # Specify multiple file patterns $ gh release download -p '*.deb' -p '*.rpm' # Download the archive of the source code for a release $ gh release download v1.2.3 --archive=zip
🌐
Zenodo
help.zenodo.org › docs › github › archive-software › github-upload
Archive a release from GitHub | Zenodo
This guide will help you create a Software record to be archived in Software Heritage. It assumes you have already enabled a repository. If you need help to enable a repository, read the following guide: ... Create a release in GitHub.
🌐
GitHub
github.com › marketplace › actions › zip-release
Zip Release · Actions · GitHub Marketplace
GitHub action that can be used to create release archive using zip or tar.
🌐
GitHub
gist.github.com › steinwaywhw › a4cd19cda655b8249d908261a62687f8
One Liner to Download the Latest Release from Github Repo · GitHub
One Liner to Download the Latest Release from Github Repo - One Liner to Download the Latest Release from Github Repo.md
🌐
GitHub
docs.github.com › en › repositories › releasing-projects-on-github › linking-to-releases
Linking to releases - GitHub Docs
For example, the URL for the latest release of octo-org/octo-repo is https://github.com/octo-org/octo-repo/releases/latest.
🌐
GitHub
docs.github.com › en › rest › releases › releases
REST API endpoints for releases - GitHub Docs
This returns a list of releases, which does not include regular Git tags that have not been associated with a release.
🌐
GitHub
docs.github.com › en › repositories › archiving-a-github-repository
Archiving a GitHub repository - GitHub Docs
You can archive, back up, and cite your work using the GitHub UI, the API, or third-party tools and services.
🌐
GitHub
docs.github.com › en › repositories › releasing-projects-on-github › automatically-generated-release-notes
Automatically generated release notes - GitHub Docs
Automatically generated release notes include a list of merged pull requests, a list of contributors to the release, and a link to a full changelog.