Install Credentials to your Github Actions netrc file. Useful for authenticating access to additional GitHub resources.
Create a workflow .yml
file in your repositories .github/workflows
directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.
machine
: Single entry mode machine.login
: Single entry mode login.password
: Single entry mode password.creds
: A JSON array of credential objects (machine
,login
,password
). Optional. Github actions doesn't support strucutred input. womp.
Either a creds
field, and/or a machine
/login
/password
combo must be passed.
None.
name: Example installing netrc creds
on: [push]
env:
- login: l12s-bot
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Apply netrc creds with direct input
uses: bcomnes/netrc-creds@v3
with:
machine: some.other.api.com
login: person
password: 1234qwer # store this in secrets
- name: Apply netrc creds with direct input again
uses: bcomnes/netrc-creds@v3
with:
machine: another.api.com
login: person
password: 1234qwer # store this in secrets
- name: Apply netrc creds with a JSON block
uses: bcomnes/netrc-creds@v3
with:
creds: |
[
{
"machine": "github.com",
"login": "${{env.login}}",
"password": "${{ secrets.GH_MACHINE_TOKEN }}"
},
{
"machine": "api.github.com",
"login": "${{env.login}}",
"password": "${{ secrets.GH_MACHINE_TOKEN }}"
}
]
Yes! netrc-creds now offers a v2 and v3 major branch pointer.
The scripts and documentation in this project are released under the MIT License
Netrc Creds is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.