GithubHelp home page GithubHelp logo

sharepoint-file-upload-action's Introduction

Sharepoint File Upload Github Action

Uploads one or more files (via glob) to Sharepoint site.

Variables

The following environment variables & secrets must be defined.

If your full Sharepoint upload path is https://example.sharepoint.com/sites/mygreatsite/Shared%20Documents/reports/detailed, the following would be defined:

  • host_name
    • 'example.sharepoint.com'
  • site_name
    • 'mygreatsite'
  • upload_path
    • 'reports/detailed'

The following will be provided to you by your Sharepoint administrator when you ask for a client ID. A reminder: put secrets in Settings/Security/Secrets and variables/Actions

  • tenant_id
  • client_id
  • client_secret

You will also need to provide the file or files being sent:

  • file_path
    • A glob; something like file.txt or *.md

The following are optional and only needed to access sharepoint intances in different clouds (ie Soverign Clouds) The defaults provided will work for all other cases

  • login_endpoint
    • A Hostname; something like login.microsoftonline.us
  • graph_endpoint
    • A Hostname; something like graph.microsoft.us

Example action.yml

name: example-file-upload
on: workflow_dispatch
jobs:
  get_report:
    runs-on: ubuntu-latest
    steps:
      - name: Create Test File
        run: touch /tmp/foo.txt
      - name: Send to Sharepoint
        uses: cringdahl/[email protected]
        with:
          file_path: "*.txt"
          host_name: 'your.sharepoint.com'
          site_name: 'some_site'
          upload_path: 'fake_files'
          tenant_id: ${{ secrets.SHAREPOINT_TENANT_ID }}
          client_id: ${{ secrets.SHAREPOINT_CLIENT_ID }}
          client_secret: ${{ secrets.SHAREPOINT_CLIENT_SECRET }}

sharepoint-file-upload-action's People

Contributors

cringdahl avatar etdofresh avatar pappasjfed avatar

Stargazers

 avatar Patrick Luzolo avatar

Watchers

Patrick Luzolo avatar  avatar  avatar

sharepoint-file-upload-action's Issues

API endpoints for need to be variablized to allow for proper Soverign Cloud Use of action

The endpoints for sovereign clouds need to be changed or variablized to allow for proper functionality.

Example:
Commercial/worldwide endpoints:
https://login.microsoftonline.com/
https://graph.microsoft.com/

These need to be changed if the SharePoint is in the US Sovereign cloud:
https://login.microsoftonline.us/
https://graph.microsoft.us/

I don't know if only the TLD country code changes (.COM -> .US) or if the full endpoint should be variables.

I like the idea of default being commercial and being able to override explicitly.

Impacts code in src/send_to_sharepoint.py lines 32 and 38.

Authentication issues

Trying out this action and ran into some authentication issues. I had my sharepoint admin create an app registration in azure portal for sharepoint and got the two IDs and secret, but when I tried to use I got the following error:

Unexpected error occurred: ('AccessDenied', 'Either scp or roles claim need to be present in the token.', '403 Client Error: Forbidden for url: https://graph.microsoft.com/v1.0/sites/{company}.sharepoint.com:/sites/{sitename}'), <class 'office365.runtime.client_request_exception.ClientRequestException'>
Traceback (most recent call last):

It could be a issue with the secret because the sharepoint admin had never done this before and I was trying to talk them through it but I wasn't really sure the correct way to do that either since Im not admin and couldn't see the screen.

Support > 250MB upload or add error/warning if > 250MB.

I thought I was doing something wrong setting up this github action on my repo trying to upload a big file (3GB+). It would just timeout after 5ish hours. After several attempts, I decided to look at the code and noticed it was using Microsoft Graph. I then started to look through its documentation, and...

I believe drive.upload_file(...) only supports <= 250MB.

Would it be possible to support > 250MB? If not could you put an error or warning for future users who try to upload and get no message? Thank you very much!

Here are some resources to help support > 250MB:

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.