Access to environment variables in autograding?

Hi Everyone,

I’m experimenting with autograder. I need to get access to the github ID of the student for my first assigment (since my school hasn’t set up the GHC integration with canvas, I am not otherwise able to harvest their github id’s to associate the user and the student, so I get them to create JSON file for me with some identifying information).

I’m not that familiar with github actions & especially with environment variables. Reading the docs, I would think tha running something like node -e "console.log(GITHUB_ACTOR)" would work for me, but I’m having no luck at all with that. I also tried modifying the classroom.yml file:

    name: GitHub Classroom Workflow

    on: [push]

    jobs:
      build:
        name: Autograding
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v2
          - uses: education/autograding@v1
        env:
          CI: true
          GA: ${{ github.actor }}

but I still don’t see how to access these env vars using javascript. Would really appreciate some help!Thanks so much!

So close and yet so far!

I was able to at least run my tests by forking and lightly modifying the education/autograding repo, and writing my own classroom.yml & autograding.json in the upstream repo. However, this does not actually activate the GHC autograder. The github actions still run on commit, but the “view test” button is missing in the teacher overview, and the Review button points to a broken link.

I would love to help fix this but I’m stymied at the moment. I think access to these variables is a common requirement and it would be worth implementing. For me at the moment, autograding is unusable, which is a real loss for my students! I’ve filed an issue in the autograding repo in case anyone wants to chime in there.

I know it’s only been a few days but I would love to hear from others here/at GH Classroom about whether this feature seems important enough to put on a roadmap. It will likely affect the extent to which I can use this feature. Maybe @d12? Thanks!

Hey!

Unfortunately I don’t have enough GitHub Actions expertise to answer your question about env variables. I’ve reached out to some engineers to see if they have ideas though.

However, this does not actually activate the GHC autograder. The github actions still run on commit, but the “view test” button is missing in the teacher overview, and the Review button points to a broken link.

The “View test” button doesn’t show up because autograding is “technically” not enabled on the repo, you’ve manually added the files yourself. This behavior will be tricky to fix until we better support your workflow (easily customizable workflow files) more natively. I could come up with even more “hacky” ways to make this work for you, but we don’t support this flow at the moment. It’s on our backlog though and we’re hoping to get to it soon!

thanks for your reply @d12! I guess I will just stay tuned for now!

© 2017 GitHub, Inc.
with by
GitHub Education