Skip to content

Commit

Permalink
rename token + remove touch + refacto echo
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanMarmelab committed Jan 26, 2024
1 parent aa51b96 commit 157b0b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This action sets up your ReactAdmin Enterprise Edition authentication by creatin

## Environnement variable

### `RA_TOKEN`
### `RA_EE_CI_TOKEN`

You have to provide your ReactAdmin Enterprise Edition secret CI token. Do not paste it directly in your repository but use [Github Encrypted Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) instead.

Expand All @@ -23,5 +23,5 @@ jobs:
steps:
- uses: react-admin/[email protected]
env:
RA_TOKEN: ${{secrets.RA_EE_CI_TOKEN}}
RA_EE_CI_TOKEN: ${{secrets.RA_EE_CI_TOKEN}}
```
34 changes: 14 additions & 20 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,26 @@ branding:
icon: "file-plus"
color: "blue"
env:
RA_TOKEN:
RA_EE_CI_TOKEN:
description: "ReactAdmin Enterprise Edition secret CI token"
required: true
runs:
using: "composite"
steps:
# create `.npmrc` file to be used by npm or Yarn v1
- name: Create .npmrc if not exists
run: |
[[ -f $HOME/.npmrc ]] || touch $HOME/.npmrc
shell: bash
- name: Complete .npmrc
run: |
echo "//registry.marmelab.com/:_authToken=${{ env.RA_TOKEN }}" >> $HOME/.npmrc
echo "@react-admin:registry=https://registry.marmelab.com" >> $HOME/.npmrc
- run: |
echo "
//registry.marmelab.com/:_authToken=${{ env.RA_EE_CI_TOKEN }}
@react-admin:registry=https://registry.marmelab.com
" >> $HOME/.npmrc
shell: bash
# create `.yarnrc.yml` file to be used by Yarn v2 or more
- name: Create .yarnrc.yml if not exists
run: |
[[ -f $HOME/.yarnrc.yml ]] || touch $HOME/.yarnrc.yml
shell: bash
- name: Complete .yarnrc.yml
run: |
echo "npmScopes:" >> $HOME/.yarnrc.yml
echo ' "react-admin":' >> $HOME/.yarnrc.yml
echo " npmAlwaysAuth: true" >> $HOME/.yarnrc.yml
echo ' npmAuthToken: "${{ env.RA_TOKEN }}"' >> $HOME/.yarnrc.yml
echo ' npmRegistryServer: "https://registry.marmelab.com"' >> $HOME/.yarnrc.yml
- run: |
echo '
npmScopes:
"react-admin":
npmAlwaysAuth: true
npmAuthToken: "${{ env.RA_EE_CI_TOKEN }}"
npmRegistryServer: "https://registry.marmelab.com"
' >> $HOME/.yarnrc.yml
shell: bash

0 comments on commit 157b0b2

Please sign in to comment.