Coder Social home page Coder Social logo

Comments (5)

sangonzal avatar sangonzal commented on July 29, 2024 1

Hi @dfmore, I haven't actually tried to do this before, so I don't know if overriding GITHUB_REPOSITORY actually works. From your screenshot, it seems that Github might not allow you to override env variables that they set.

Another way of going about this is to define another env variable, something like REPOSITORY_NAME, and check in main.py if it's set. If REPOSITORY_NAME is set, then use it, if not then fallback to GITHUB_REPOSITORY.

I don't have time to make the changes right now and test, but happy to merge in a PR with these changes. Next time I do have time to work on the project I'll see if I can get this in.

from repository-traffic-action.

sangonzal avatar sangonzal commented on July 29, 2024

Hi @thias15! Should a forked repositories views and clones count towards the upstream repository? Do you know what GitHub does for this scenario?

I think I would expect a forked repos stats to be separate from the upstream repo, given that forked repo can become it's own separate thing.

Either way I don't think there is anything that can be done, apart from the person who forked creating a PAT and using it to log metrics for the fork.

from repository-traffic-action.

thias15 avatar thias15 commented on July 29, 2024

It would be nice to have the repo name as an input rather than using GITHUB_REPOSITORY

from repository-traffic-action.

sangonzal avatar sangonzal commented on July 29, 2024

Sorry, hadn't seen your latest comment. I think it would be reasonable to let the user override GITHUB_REPOSITORY with their own value by setting an env variable. By the way have you tried overriding GITHUB_REPOSITORY by setting it on the yaml file? Something along the lines of:

    - name: GitHub traffic 
      uses: sangonzal/[email protected]
      env:
        TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }}
         GITHUB_REPOSITORY: name_you_want_to_use

I don't have time to make the changes and test right now, but if you'd like to make the change I would merge the pull request in and release a new version.

from repository-traffic-action.

dfmore avatar dfmore commented on July 29, 2024

Hi @sangonzal 👋🏽 I've tried your suggestion about using the GITHUB_REPOSITORY env but couldn't get it to work.

I'm running your action from the innovyze/Traffic-Data repository on traffic from the innovyze/Open-Source-Support repository.

See below:
image

It seems that the environment variable has been recognised, but the action is still being applied to traffic in the innovyze/Traffic-Data repository.

Do you know what I'm getting wrong?

from repository-traffic-action.

Related Issues (10)

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.