Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run the Autograding workflow from the terminal #1

Open
lakruzz opened this issue Feb 25, 2023 · 1 comment
Open

Run the Autograding workflow from the terminal #1

lakruzz opened this issue Feb 25, 2023 · 1 comment
Labels
Template Template issue

Comments

@lakruzz
Copy link
Member

lakruzz commented Feb 25, 2023

The GitHub Action workflows live in the .gitghub/workflows folder - seen from the root of the repository.

Inside this folder, you can have one or more workflows - each workflow is a YAML file (.yml) which declares what it going to happen on which events.

The repositories from the two previous exercises: "Social Coding" and "Bin Bash and the whole Shebang" both contained a workflow in that .github/workflows folder. It was the autograding job for GitHub Classroom: classroom.yml.

  • Browse to the file .github/worflows/classroom.yml in one (any) of your previous repositories and copy the content of the file as a code-snippets highlighted as yaml into the comments of this issue.
  • Make notes (...to yourselves) in the comments to this issue:
  • What triggers this particular workflow?
  • Which other types of triggers does GitHub Actions support (leave a link to some useful documentation)
  • What is going on in this step below? You can probably guess it - but if you should actually know - where would you then find the documentation on actions/checkout? Throw a link in the comments!
steps:
- uses: actions/checkout@v2
  • What would it require to execute the workflow manually from a terminal on your own PC (not a CodeSpace). Make your notes on this issue.
  • Also consider: What would you do - if any dependencies (like the GitHub Cli) also must be installed using a CLI?
💡 HINTS: Discuss it in the group before you reach for help!

Optional:

Work together - as a team - to get this setup to work on every team member's PC

@lakruzz lakruzz added the Template Template issue label Feb 25, 2023
@lakruzz
Copy link
Member Author

lakruzz commented Feb 26, 2023

could not create workflow dispatch event: HTTP 403: Resource not accessible by integration

SPOILER: Why doesn't gh workflow run work from the codespace?

The security settings on CodeSpaces are default limited to read or read-write scope on the repo.

So you don't have the workflow scope required to trigger the workflow from the CLI

To test run:

gh auth status

However - the default setting on a manual gh auth login is gist, read:org, repo, workflow Exactly what you need! The solution is simply to log out and back in to generate a standard token - which requires you to blank the $GITHUB_TOKEN environment variable first:

unset GITHUB_TOKEN && gh auth login

It plays like this:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Template Template issue
Projects
None yet
Development

No branches or pull requests

1 participant