Skip to content

Commit 10dfd36

Browse files
committed
Renames action to 'CLI for Microsoft 365 Login'
1 parent c8c75ea commit 10dfd36

File tree

7 files changed

+53
-39
lines changed

7 files changed

+53
-39
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Office 365 CLI login GitHub action
2-
GitHub action to login to a tenant using Office 365 CLI.
1+
# CLI for Microsoft 365 Login
2+
GitHub action to login to a tenant using CLI for Microsoft 365.
33

4-
![Office 365 CLI Login](./images/cli-login.png)
4+
![CLI for Microsoft 365](./images/pnp-cli-microsoft365-blue.svg)
55

6-
This GitHub Action (created using typescript) uses [Office 365 CLI](https://pnp.github.io/office365-cli/), specifically the [login command](https://pnp.github.io/office365-cli/cmd/login), to allow you log in to Office 365.
6+
This GitHub Action (created using typescript) uses [CLI for Microsoft 365](https://pnp.github.io/cli-microsoft365/), specifically the [login command](https://pnp.github.io/cli-microsoft365/cmd/login), to allow you log in to Microsoft 365.
77

88
## Usage
99
### Pre-requisites
10-
Create a workflow `.yml` file in your `.github/workflows` directory. An [example workflow](#example-workflow---office-365-cli-login) 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).
10+
Create a workflow `.yml` file in your `.github/workflows` directory. An [example workflow](#example-workflow---cli-for-microsoft-365-login) 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).
1111

1212
### Inputs
1313
- `ADMIN_USERNAME` : **Required** Username (email address of the admin)
@@ -19,11 +19,11 @@ Since this action requires user name and password which are sensitive pieces of
1919
- `adminPassword` - store the password of that user in this.
2020
These secrets are encrypted and can only be used by GitHub actions.
2121

22-
### Example workflow - Office 365 CLI Login
22+
### Example workflow - CLI for Microsoft 365 Login
2323
On every `push` build the code and then login to Office 365 before deploying.
2424

2525
```yaml
26-
name: SPFx CICD with O365 CLI
26+
name: SPFx CICD with Cli for Microsoft 365
2727

2828
on: [push]
2929

@@ -46,9 +46,9 @@ jobs:
4646
## Code to get the package omitted
4747
##
4848

49-
# Office 365 cli login action
49+
# CLI for Microsoft 365 login action
5050
- name: Login to tenant
51-
uses: pnp/action-cli-login@v1.0.0
51+
uses: pnp/action-cli-login@v2.0.0
5252
with:
5353
ADMIN_USERNAME: ${{ secrets.adminUsername }}
5454
ADMIN_PASSWORD: ${{ secrets.adminPassword }}
@@ -63,5 +63,8 @@ If self-hosted runners are used for running the workflow, then please make sure
6363

6464
## Release notes
6565

66+
### v2.0.0
67+
- Renames action to 'CLI for Microsoft 365'
68+
6669
### v1.0.0
6770
- Added inital 'Office 365 CLI login' GitHub action solving #2

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: 'Office 365 CLI Login'
2-
description: 'Login to tenant using Office 365 CLI'
1+
name: 'CLI for Microsoft 365 Login'
2+
description: 'Login to tenant using CLI for Microsoft 365'
33
inputs:
44
ADMIN_USERNAME:
55
description: 'Username (email address) of the admin'

dist/index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -973,27 +973,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
973973
const core = __importStar(__webpack_require__(470));
974974
const exec_1 = __webpack_require__(986);
975975
const io_1 = __webpack_require__(1);
976-
let o365CLIPath;
976+
let cliMicrosoft365Path;
977977
function main() {
978978
return __awaiter(this, void 0, void 0, function* () {
979979
try {
980980
const username = core.getInput("ADMIN_USERNAME", { required: true });
981981
const password = core.getInput("ADMIN_PASSWORD", { required: true });
982-
core.info("ℹ️ Installing Office 365 CLI...");
983-
const o365CLIInstallCommand = "npm install -g @pnp/office365-cli";
982+
core.info("ℹ️ Installing CLI for Microsoft 365...");
983+
const cliMicrosoft365InstallCommand = "npm install -g @pnp/cli-microsoft365";
984984
const options = {};
985985
options.silent = true;
986986
if (process.env.RUNNER_OS == "Windows") {
987-
yield exec_1.exec(o365CLIInstallCommand, [], options);
987+
yield exec_1.exec(cliMicrosoft365InstallCommand, [], options);
988988
}
989989
else {
990-
yield exec_1.exec(`sudo ${o365CLIInstallCommand}`, [], options);
990+
yield exec_1.exec(`sudo ${cliMicrosoft365InstallCommand}`, [], options);
991991
}
992-
o365CLIPath = yield io_1.which("o365", true);
993-
core.info("✅ Completed installing Office 365 CLI.");
992+
cliMicrosoft365Path = yield io_1.which("m365", true);
993+
core.info("✅ Completed installing CLI for Microsoft 365.");
994994
core.info("ℹ️ Logging in to the tenant...");
995-
yield executeO365CLICommand(`login --authType password --userName ${username} --password ${password}`);
996-
yield executeO365CLICommand("status");
995+
yield executeCLIMicrosoft365Command(`login --authType password --userName ${username} --password ${password}`);
996+
yield executeCLIMicrosoft365Command("status");
997997
core.info("✅ Login successful.");
998998
}
999999
catch (err) {
@@ -1002,10 +1002,10 @@ function main() {
10021002
}
10031003
});
10041004
}
1005-
function executeO365CLICommand(command) {
1005+
function executeCLIMicrosoft365Command(command) {
10061006
return __awaiter(this, void 0, void 0, function* () {
10071007
try {
1008-
yield exec_1.exec(`"${o365CLIPath}" ${command}`, [], {});
1008+
yield exec_1.exec(`"${cliMicrosoft365Path}" ${command}`, [], {});
10091009
}
10101010
catch (err) {
10111011
throw new Error(err);

images/cli-login.png

-55.1 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Loading

package.json

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"name": "@pnp/action-cli-login",
3-
"version": "1.0.0",
4-
"description": "GitHub Action to Login to a tenant using Office 365 CLI",
3+
"version": "2.0.0",
4+
"description": "GitHub Action to Login to a tenant using CLI for Microsoft 365",
55
"main": "dist/index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1",
8-
"build": "ncc build src\\main.ts"
7+
"build": "ncc build src/main.ts"
98
},
109
"author": "Tatti, Anoop <anoop@live.co.uk>",
1110
"maintainers": [
@@ -23,6 +22,16 @@
2322
"name": "Garry Trinder",
2423
"email": "garry.trinder@live.com",
2524
"web": "https://garrytrinder.github.io/"
25+
},
26+
{
27+
"name": "Albert-Jan Schot",
28+
"email": "appie@digiwijs.nl",
29+
"web": "https://www.cloudappie.nl/"
30+
},
31+
{
32+
"name": "Rabia Williams",
33+
"email": "rabiawilliams@gmail.com",
34+
"web": "https://rabiawilliams.com/"
2635
}
2736
],
2837
"contributors": [
@@ -41,10 +50,11 @@
4150
"url": "https://github.com/pnp/action-cli-login/issues"
4251
},
4352
"keywords": [
44-
"GitHub action",
4553
"office 365",
54+
"microsoft 365",
4655
"sharepoint framework",
4756
"o365",
57+
"m365",
4858
"spfx",
4959
"sharepoint online",
5060
"sharepoint",
@@ -67,4 +77,4 @@
6777
"typescript": "^3.7.4",
6878
"@types/node": "^13.1.6"
6979
}
70-
}
80+
}

src/main.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@ import * as core from '@actions/core';
22
import { exec } from '@actions/exec';
33
import { which } from '@actions/io';
44

5-
let o365CLIPath: string;
5+
let cliMicrosoft365Path: string;
66

77
async function main() {
88
try {
99
const username: string = core.getInput("ADMIN_USERNAME", { required: true });
1010
const password: string = core.getInput("ADMIN_PASSWORD", { required: true });
1111

12-
core.info("ℹ️ Installing Office 365 CLI...");
12+
core.info("ℹ️ Installing CLI for Microsoft 365...");
1313

14-
const o365CLIInstallCommand: string = "npm install -g @pnp/office365-cli";
14+
const cliMicrosoft365InstallCommand: string = "npm install -g @pnp/cli-microsoft365";
1515
const options: any = {};
1616
options.silent = true;
1717
if (process.env.RUNNER_OS == "Windows") {
18-
await exec(o365CLIInstallCommand, [], options);
18+
await exec(cliMicrosoft365InstallCommand, [], options);
1919
} else {
20-
await exec(`sudo ${o365CLIInstallCommand}`, [], options);
20+
await exec(`sudo ${cliMicrosoft365InstallCommand}`, [], options);
2121
}
22-
o365CLIPath = await which("o365", true);
22+
cliMicrosoft365Path = await which("m365", true);
2323

24-
core.info("✅ Completed installing Office 365 CLI.");
24+
core.info("✅ Completed installing CLI for Microsoft 365.");
2525

2626
core.info("ℹ️ Logging in to the tenant...");
2727

28-
await executeO365CLICommand(`login --authType password --userName ${username} --password ${password}`);
29-
await executeO365CLICommand("status");
28+
await executeCLIMicrosoft365Command(`login --authType password --userName ${username} --password ${password}`);
29+
await executeCLIMicrosoft365Command("status");
3030

3131
core.info("✅ Login successful.");
3232

@@ -36,9 +36,9 @@ async function main() {
3636
}
3737
}
3838

39-
async function executeO365CLICommand(command: string) {
39+
async function executeCLIMicrosoft365Command(command: string) {
4040
try {
41-
await exec(`"${o365CLIPath}" ${command}`, [], {});
41+
await exec(`"${cliMicrosoft365Path}" ${command}`, [], {});
4242
}
4343
catch (err) {
4444
throw new Error(err);

0 commit comments

Comments
 (0)