Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

netrc action

build

This GitHub Action will append an entry to the ~/.netrc file for you. File owner and access permission checks are done before writing to the file.

Usage

Inputs

NameRequiredDescriptionTypeDefault
machineyesIdentifies a remote machine namestring
usernamenoThe user name for the remote machinestring''
passwordnoThe password for the remote machinestring''

Basic example

Add the following to your workflow.

- uses: extractions/netrc@3with:
machine: some.private.domain.comusername: ${{ secrets.USERNAME }}password: ${{ secrets.PASSWORD }}

Example use case

In the below example we have a Python project that needs to install packages from a private PyPI registry. We want to be able to check-in a requirements.txt that contains an extra index URL but we don't want to check-in the credentials

requirements.txt:

--extra-index-url https://pypi.private.domain.com
requests==2.23.0
private-package==2.8.3

.github/workflows/build.yaml:

on: [push]name: buildjobs:
check:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v4
- uses: extractions/netrc@v3with:
machine: pypi.private.domain.comusername: ${{ secrets.PYPI_USERNAME }}password: ${{ secrets.PYPI_PASSWORD }}
- uses: actions/setup-python@v5with:
python-version: 3.8
- run: pip install -r requirements.txt# tests follow...

License

Licensed under either of

at your option.

About

GitHub Action to append an entry to ~/.netrc

Topics

Resources

Stars

33 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages