Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/little-core-labs/netrc-creds
Install netrc creds to your Github Action environment
https://github.com/little-core-labs/netrc-creds
actions github netrc-creds workflow
Last synced: 1 day ago
JSON representation
Install netrc creds to your Github Action environment
- Host: GitHub
- URL: https://github.com/little-core-labs/netrc-creds
- Owner: little-core-labs
- License: mit
- Created: 2020-02-28T17:39:25.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-22T15:15:16.000Z (almost 2 years ago)
- Last Synced: 2024-03-15T12:49:03.086Z (10 months ago)
- Topics: actions, github, netrc-creds, workflow
- Language: JavaScript
- Homepage: https://github.com/marketplace/actions/netrc-credentials
- Size: 171 KB
- Stars: 5
- Watchers: 4
- Forks: 8
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# netrc-creds
Install Credentials to your Github Actions netrc file. Useful for authenticating access to additional GitHub resources.## Usage
### Pre-requisites
Create a workflow `.yml` file in your repositories `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).### Inputs
- `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.
### Outputs
None.
### Example workflow
```yaml
name: Example installing netrc credson: [push]
env:
- login: l12s-botjobs:
build:runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]steps:
- uses: actions/checkout@v1
- name: Apply netrc creds with direct input
uses: little-core-labs/netrc-creds@master
with:
machine: some.other.api.com
login: person
password: 1234qwer # store this in secrets
- name: Apply netrc creds with direct input again
uses: little-core-labs/netrc-creds@master
with:
machine: another.api.com
login: person
password: 1234qwer # store this in secrets
- name: Apply netrc creds with a JSON block
uses: little-core-labs/[email protected]
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 }}"
}
]
```## FAQ
### Can you offer a major version tag/branch alias? I want automatic updates!
Nope! This was always weird/bad pattern of github actions. Luckily github offers a solution for this. Create a `.github/dependabot.yml` with, at a minimum, the following config:
```yaml
# Basic dependabot.yml file with
# minimum configuration for two package managersversion: 2
updates:
# Enable version updates for npm
# Enable updates to github actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"```
## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)