Giter VIP home page Giter VIP logo

action-cli-deploy's Introduction

page_type products languages extensions
sample
office-sp
csharp
contentType createdDate
samples
7/26/2014 7:08:15 PM

Patterns and Practices

ARCHIVED - Notice that many of the samples in this repository are for legacy add-in model. You should be using SharePoint Framework for UX layer extensibility for SharePoint and Microsoft Teams. You can find SPFx web part and SPFx extension samples from different repository. You can use Azure AD and Microsoft Teams Solution model as replacement for the provider hosted add-in model. Please see https://aka.ms/m365pnp for the up to date guidance and samples.

This is the main repository for the community driven Microsoft 365 Patterns and Practices (PnP) initiative. If you are looking for latest news around PnP or related topics, please have a look on our one pager at http://aka.ms/m365pnp.

PnP initiative has numerous GitHub repositories, so that you can more easily find what's relevant for you depending on your interest. Easiest way to follow up on latest changes is our landing page at http://aka.ms/m365pnp.

"Sharing is caring"

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

action-cli-deploy's People

Contributors

anoopt avatar garrytrinder avatar jwaegebaert avatar martinlingstuyl avatar milanholemans avatar velingeorgiev avatar waldekmastykarz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

action-cli-deploy's Issues

Site collection admins are not allowed to deploy

I have some site collections that have site collection level app catalog(mysite/appcatalog not apps/appcatalog) and I want to deploy using pnp action, but Office 365 CLI only allows tenant admins to deploy.

Please allow site collection admins to deploy to the site that he owns.

Maintenance Updates

Prompted by #16

This issue is to make this action consistent with the action-cli-login and enable us to update dependencies with confidence that we are not breaking existing functionality.

  • Remove releases from readme
  • Update maintainers
  • Increment version number
  • Create master from main
  • Remove tslint
  • Update tsconfig
  • Update dependencies
  • Update examples to use semver v2
  • Add unit tests using mocha
  • Add code coverage using c8
  • Add test workflow
  • Add PR check workflow
  • Update action.yml
  • Update to use node@18
  • Update gitignore
  • Set main branch as default branch
  • Remove master branch
  • Release new version to marketplace

Publish the GitHub action on the marketplace

We will have to perform few things to achieve this:

  • Research how to publish GitHub action on the Marketplace
  • Release version v1 (with tag included) of the GitHub action
  • Publish the GitHub action on the marketplace

--skipFeatureDeployment not included in spo app deploy command on Windows

When this action is used to deploy a solution to SharePoint tenant from a Windows task runner the skipFeatureDeployment flag is not included in the command. This is due to the appId parameter including a return carriage character that escapes the string.

Steps to reproduce

  1. Include this action in a GitHub Action using the windows-latest runner.

  2. set SKIP_FEATURE_DEPLOYMENT to true.

The following log shows the --skipFeatureDeployment flag being printed on the following line rather than being included in the deploy command.

/usr/local/bin/o365 spo app add -p solution.sppkg --overwrite
 ***app-id***

/usr/local/bin/o365 spo app deploy --id ***app-id***
 --skipFeatureDeployment

[BUG]: npm test throws `Cannot use import statement outside a module` error

(node:1788) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)

/home/runner/work/action-cli-deploy/action-cli-deploy/lib/commands.spec.js:1
import * as assert from 'assert';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1178:20)
    at Module._compile (node:internal/modules/cjs/loader:1220:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Function.Module._load (node:internal/modules/cjs/loader:960:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:[25](https://github.com/pnp/action-cli-deploy/actions/runs/6525749892/job/17718797119?pr=28#step:9:26))
----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------|---------|----------|---------|---------|-------------------
All files |       0 |        0 |       0 |       0 |                   
----------|---------|----------|---------|---------|-------------------

=============================== Coverage summary ===============================
Statements   : Unknown% ( 0/0 )
Branches     : Unknown% ( 0/0 )
Functions    : Unknown% ( 0/0 )
Lines        : Unknown% ( 0/0 )
================================================================================
Error: Process completed with exit code 1.

Invalid option "scope" when deploying

I'm getting an invalid option "scope" when deploying. Using v.2.

image

Per the help docs it looks like the flag should be -s

-s, --appCatalogScope [appCatalogScope] Scope of the app catalog: tenant,sitecollection. Default tenant

Not sure if this is something I configure in YAML file. Please advise.

Dependabot alerts

Hi,
I would like to make a request about vulnerabilities detect in the security scan.
I have clone this repository and I haved passed a security scan. The Dependabot alerts show 3 vulnerabilities related to dependencies version included in the package-lock.json:

  • path-parse version 1.0.6 --> fixed vulnerability in version 1.0.7 or later
  • @actions/core version 1.2.1-->fixed vulnerability in version 1.2.6 or later
  • minimist version 0.0.8 --> fixed vulnerability in version 0.2.1 or later

Please, I would like to know if there is any plan to upgrade these dependencies version in orden to eliminate le vulnerabilities.

Thanks in advanced

Tests failing

Source: https://github.com/pnp/action-cli-deploy/actions/runs/6525749892/job/17718797119?pr=28#step:9:24

(node:1788) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)

/home/runner/work/action-cli-deploy/action-cli-deploy/lib/commands.spec.js:1
import * as assert from 'assert';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1178:20)
    at Module._compile (node:internal/modules/cjs/loader:1220:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Function.Module._load (node:internal/modules/cjs/loader:960:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:[25](https://github.com/pnp/action-cli-deploy/actions/runs/6525749892/job/17718797119?pr=28#step:9:26))

Create Office 365 CLI deploy app GitHub action

Office 365 CLI deploy GitHub action

GitHub action to deploy an app using Office 365 CLI

This GitHub Action (created using typescript) uses Office 365 CLI, specifically the spo app add, spo app deploy and spo app install commands, to add, deploy and (if site collection) install an app.

Usage

Pre-requisites

Create a workflow .yml file in your .github/workflows directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.

Dependencies on other GitHub Actions

  • Office 365 CLI LoginRequired . This action is dependant on action-cli-login. So in the workflow we need to run action-cli-login before using this action.

Inputs

  • APP_FILE_PATH : Required Relative path of the app in your repo.
  • SCOPE : Scope of the app catalog: tenant|sitecollection. Default tenant.
  • SITE_COLLECTION_URL : The URL of the site collection where the solution package will be added and installed. It must be specified when the scope is sitecollection.
  • SKIP_FEATURE_DEPLOYMENT : true|false If the app supports tenant-wide deployment, deploy it to the whole tenant.
  • OVERWRITE : true|false Set to overwrite the existing package file.

Output

  • APP_ID : The id of the app that gets deployed

Flush SPFX Cache on Deploy to tenant

This is more of a question rather than an actual issue. We are experiencing caching issues whend deploying SPFX app to SharePoint similar to SharePoint/sp-dev-docs#8915. I'm wondering if there is something that can be done via this action or m365 cli - to flush all existing assets before deploying (contents of .spkkg file). Thanks.

`spo app add` not returning `UniqueId` anymore.

Originates from: #11 (comment)

Apparently we broke the GitHub action flow by defining the default output in the CLI runtime. Because of this issue: pnp/cli-microsoft365#3445

Our default output value used to be undefined, by refactoring this to json, the command will now return the entire app object instead of just the ID.

https://github.com/pnp/cli-microsoft365/blob/e42aed1530b6755b2485a944bbd9a251aac3fddb/src/m365/spo/commands/app/app-add.ts#L127-L132

Therefore these lines of code will fail:

appId = await executeCLIMicrosoft365Command(`spo app add -p ${appFilePath} --scope sitecollection --appCatalogUrl ${siteCollectionUrl} ${overwrite}`, true);
await executeCLIMicrosoft365Command(`spo app deploy --id ${appId} --scope sitecollection --appCatalogUrl ${siteCollectionUrl} ${skipFeatureDeployment}`);

appId = await executeCLIMicrosoft365Command(`spo app add -p ${appFilePath} ${overwrite}`, true);
await executeCLIMicrosoft365Command(`spo app deploy --id ${appId} ${skipFeatureDeployment}`);

GH action logs have the CLI spinner running command output in them

🤔 Problem

Since CLI is interactive by default in logs we will see that CLI shows the spinner.
image

Although it does not break the step and produce no harm it is just not needed/wanted log that we should avoid

🐞🔨 Fix proposal

To resolve this we should run m365 setup —scripting —output none at the beginning of the action so that CLI will not present any interactive response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.