Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/massivdash/ado-npmrc-ts-action
Github Action for creating .npmrc file and connecting to azure dev ops feed / npm registry
https://github.com/massivdash/ado-npmrc-ts-action
Last synced: 1 day ago
JSON representation
Github Action for creating .npmrc file and connecting to azure dev ops feed / npm registry
- Host: GitHub
- URL: https://github.com/massivdash/ado-npmrc-ts-action
- Owner: MassivDash
- License: mit
- Created: 2024-07-17T19:16:32.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-05T15:26:55.000Z (3 months ago)
- Last Synced: 2024-08-05T18:12:37.897Z (3 months ago)
- Language: TypeScript
- Size: 1.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
📦 Azure Dev Ops .npmrc maker github action
![GitHub Super-Linter](https://github.com/MassivDash/ado-npmrc-ts-action/actions/workflows/linter.yml/badge.svg)![CI](https://github.com/MassivDash/ado-npmrc-ts-action/actions/workflows/ci.yml/badge.svg)![Compliation](https://github.com/MassivDash/ado-npmrc-ts-action/actions/workflows/check-dist.yml/badge.svg)![CodeCoverage](./badges/coverage.svg)
**Platforms**
![windows](https://img.shields.io/badge/Platform-Windows-blue)
![linux](https://img.shields.io/badge/Platform-Linux-blue)
![macOs](https://img.shields.io/badge/Platform-MacOs-blue)This action will create a .npmrc file with authorization needed to access Azure
Dev Ops internal npm registry / feed. Works on all github OS machines (Windows,
Linux, MacOS)**Minimal node version**
![Static Badge](https://img.shields.io/badge/_node_-%3E%3D_20.6.0-red)
```
registry=https://pkgs.dev.azure.com/AZURE_ORGANIZATION/_packaging/AZURE_REGISTRY_NAME/npm/registry/
always-auth=true
; begin auth token
//pkgs.dev.azure.com/AZURE_ORGANIZATION/_packaging/AZURE_REGISTRY_NAME/npm/registry/:username=AZURE_USERNAME
//pkgs.dev.azure.com/AZURE_ORGANIZATION/_packaging/AZURE_REGISTRY_NAME/npm/registry/:_password=AZURE_PASSWORD
//pkgs.dev.azure.com/AZURE_ORGANIZATION/_packaging/AZURE_REGISTRY_NAME/npm/registry/:email=AZURE_EMAIL
//pkgs.dev.azure.com/AZURE_ORGANIZATION/_packaging/AZURE_REGISTRY_NAME/npm/:username=AZURE_USERNAME
//pkgs.dev.azure.com/AZURE_ORGANIZATION/_packaging/AZURE_REGISTRY_NAME/npm/:_password=AZURE_PASSWORD
//pkgs.dev.azure.com/AZURE_ORGANIZATION/_packaging/AZURE_REGISTRY_NAME/npm/:email=AZURE_EMAIL
; end auth token
```\*action works with project based feeds aswell
Works on all OS types (mac, windows, linux) with node >= 20.0.0 setup
---
## Prerequisites
- Azure Dev Ops npm registry
- Azure PAT token---
## Variables
| Variable | Description | Required | Example | Type |
| --------------------- | ----------------------------------------------------------------------------------- | -------- | ------------- | ------- |
| AZURE_PASSWORD | Azure Dev Ops PAT token encoded as BASE64 string or "pure" PAT | Yes | BASE64_STRING | string |
| AZURE_REGISTRY_NAME | Name of the registry | Yes | Upstream | string |
| AZURE_ORGANIZATION | Name of your ADO organization | Yes | Org | string |
| AZURE_PROJECT | NAME of your Project (optional) | No | Project | string |
| AZURE_USERNAME | Name of the user, usually the same as ORG | No | ORG | string |
| AZURE_EMAIL | Email of the user, creator of the AZURE_PASSWORD | Yes | [email protected] | string |
| AZURE_REGISTRY_SCOPE | Scope for the registry (optional) | No | @your-org | string |
| AZURE_ENCODE_PASSWORD | Indicates if the AZURE_PASSWORD is encoded as BASE64 string or "pure" PAT, optional | No | false | boolean |---
## Usage
Here's an example of how to use this action in a workflow file:
```yaml
name: Example Workflow
on:
workflow_dispatch:
inputs:
inputs:
AZURE_PASSWORD:
description:
'Azure Dev Ops PAT token encoded as BASE64 string or "pure" PAT'
required: true
default: ''
type: string
AZURE_REGISTRY_NAME:
description: 'Name of the registry'
required: true
default: 'Upstream'
type: string
AZURE_ORGANIZATION:
description: 'Name of your ADO organization'
required: true
default: 'Org'
type: string
AZURE_PROJECT:
description: 'NAME of your Project (optional)'
required: false
default: 'Project'
type: string
AZURE_USERNAME:
description: 'Name of the user, usually the same as ORG'
required: false
default: 'ORG'
type: string
AZURE_EMAIL:
description: 'Email of the user, creator of the AZURE_PASSWORD'
required: true
default: '[email protected]'
type: string
AZURE_REGISTRY_SCOPE:
description: 'Scope for the registry (optional)'
required: false
default: '@your-org'
type: string
AZURE_ENCODE_PASSWORD:
description:
'Indicates if the AZURE_PASSWORD is encoded as BASE64 string or
"pure" PAT, optional'
required: false
default: false
type: booleanjobs:
test:
name: Test
runs-on: ubuntu-lateststeps:
# Change @main to a specific commit SHA or version tag, e.g.:
# MassivDash/ado-npmrc-ts-action@e76147da8e5c81eaf017dede5645551d4b94427b
# MassivDash/[email protected]- name: Create a Azure Dev Ops .npmrc file
id: ado-npmrc
uses: MassivDash/[email protected]
with:
AZURE_PASSWORD: { { secrets.AZURE_PASSWORD } }
AZURE_REGISTRY_NAME: 'registry'
AZURE_USERNAME: 'username'
AZURE_ORGANIZATION: 'organization'
AZURE_EMAIL: '[email protected]'
```---
Luke Celitan, [Spaceghost](https://spaceout.pl/about)
x: [@Spaceout.pl] https://spaceout.pl